MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / bin_pop_int

Function bin_pop_int

bin_interface.c:373–387  ·  view source on GitHub ↗

* pops an integer value from the current position in the buffer * @info: pointer to store the result * * @return: * 0 (success): info retrieved * 1 (success): nothing returned, all data has been consumed! * < 0: error */

Source from the content-addressed store, hash-verified

371 * < 0: error
372 */
373int bin_pop_int(bin_packet_t *packet, void *info)
374{
375 if (packet->front_pointer - packet->buffer.s == packet->buffer.len)
376 return 1;
377
378 if (packet->front_pointer - packet->buffer.s + sizeof(int) > packet->buffer.len) {
379 LM_ERR("Receive binary packet buffer overflow\n");
380 return -1;
381 }
382
383 memcpy(info, packet->front_pointer, sizeof(int));
384 packet->front_pointer += sizeof(int);
385
386 return 0;
387}
388
389/*
390 * pops an integer value from the end of the packet

Callers 15

handle_pres_updateFunction · 0.85
ds_status_updateFunction · 0.85
lb_recv_status_updateFunction · 0.85
cache_replicated_insertFunction · 0.85
bin_pop_streamFunction · 0.85
unpack_update_fieldsFunction · 0.85
receive_entity_createFunction · 0.85
receive_entity_updateFunction · 0.85
receive_entity_deleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected