Beispiel #1
0
int 
smpp34_pack2(uint8_t *ptrBuf, int ptrSize, int *ptrLen, void* tt)
{
    uint32_t cmdid;
    memcpy(&cmdid, tt+4, sizeof(uint32_t));
    return( smpp34_pack(cmdid, ptrBuf, ptrSize, ptrLen, tt) );
};
Beispiel #2
0
static int pack_and_send(struct esme *esme, uint32_t type, void *ptr)
{
	struct msgb *msg = msgb_alloc(4096, "SMPP_Tx");
	int rc, rlen;
	if (!msg)
		return -ENOMEM;

	rc = smpp34_pack(type, msg->tail, msgb_tailroom(msg), &rlen, ptr);
	if (rc != 0) {
		LOGP(DSMPP, LOGL_ERROR, "[%s] Error during smpp34_pack(): %s\n",
		     esme->system_id, smpp34_strerror);
		msgb_free(msg);
		return -EINVAL;
	}
	msgb_put(msg, rlen);

	return osmo_wqueue_enqueue(&esme->wqueue, msg);
}