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

Function bin_init_buffer

bin_interface.c:128–142  ·  view source on GitHub ↗

* initializes a packet with a buffer received * this is useful when you only have a pre-built buffer */

Source from the content-addressed store, hash-verified

126 * this is useful when you only have a pre-built buffer
127 */
128void bin_init_buffer(bin_packet_t *packet, char *buffer, int length)
129{
130 str capability;
131
132 packet->buffer.len = length;
133 packet->buffer.s = buffer;
134 packet->size = length;
135 packet->flags = 0;
136
137 bin_get_capability(packet, &capability);
138
139 memcpy(&packet->type, capability.s + capability.len, sizeof(int));
140 packet->front_pointer = capability.s + capability.len + CMD_FIELD_SIZE;
141 LM_DBG("init buffer length %d\n", length);
142}
143
144int bin_append_buffer(bin_packet_t *packet, str *buf)
145{

Callers 5

srec_loaded_callbackFunction · 0.85
run_create_cb_allFunction · 0.85
run_cb_buf_pktFunction · 0.85
run_mod_packet_cbFunction · 0.85

Calls 1

bin_get_capabilityFunction · 0.85

Tested by

no test coverage detected