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

Function bin_push_int

bin_interface.c:207–224  ·  view source on GitHub ↗

* adds a new integer value at the end position in the packet * * @return: * > 0: success, the size of the packet * < 0: internal buffer limit reached */

Source from the content-addressed store, hash-verified

205 * < 0: internal buffer limit reached
206 */
207int bin_push_int(bin_packet_t *packet, int info)
208{
209 if (!packet->buffer.s || !packet->size) {
210 LM_ERR("not initialized yet, call bin_init before altering buffer\n");
211 return -1;
212 }
213
214 if (packet->buffer.len + sizeof info > packet->size) {
215 if (bin_extend(packet, sizeof info) < 0)
216 return -1;
217 }
218
219 memcpy(packet->buffer.s + packet->buffer.len, &info, sizeof info);
220 packet->buffer.len += sizeof info;
221
222 set_len(packet);
223 return packet->buffer.len;
224}
225
226/*
227 * removes @count integers from the end of the packet

Callers 15

bin_push_pres_updateFunction · 0.85
bin_push_dst_statusFunction · 0.85
bin_push_dst_statusFunction · 0.85
bin_push_presentityFunction · 0.85
replicate_cache_insertFunction · 0.85
receive_sync_requestFunction · 0.85
bin_push_streamFunction · 0.85
bin_pack_entity_coordsFunction · 0.85
bin_pack_entityFunction · 0.85
bin_push_urecordFunction · 0.85

Calls 2

bin_extendFunction · 0.85
set_lenFunction · 0.85

Tested by

no test coverage detected