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

Function lumps_len

msg_translator.c:449–493  ·  view source on GitHub ↗

! \brief computes the "unpacked" len of a lump list, code moved from build_req_from_req */

Source from the content-addressed store, hash-verified

447/*! \brief computes the "unpacked" len of a lump list,
448 code moved from build_req_from_req */
449static int lumps_len(struct sip_msg* msg, struct lump* lumps,
450 const struct socket_info* send_sock, int max_offset)
451{
452 unsigned int s_offset, new_len;
453 unsigned int last_del;
454 struct lump *t, *r;
455 const str *send_address_str, *send_port_str;
456 const str *rcv_address_str=NULL;
457 const str *rcv_port_str=NULL;
458
459#define SUBST_LUMP_LEN(subst_l) \
460 switch((subst_l)->u.subst){ \
461 case SUBST_RCV_IP: \
462 if (msg->rcv.bind_address){ \
463 new_len+=rcv_address_str->len; \
464 } else \
465 LM_BUG("null bind address 1"); \
466 break; \
467 case SUBST_RCV_PORT: \
468 if (msg->rcv.bind_address){ \
469 new_len+=rcv_port_str->len; \
470 } else \
471 LM_BUG("null bind address 2"); \
472 break; \
473 case SUBST_RCV_PROTO: \
474 if (msg->rcv.bind_address){ \
475 switch(msg->rcv.bind_address->proto){ \
476 /* TODO change this to look in proto !*/ \
477 case PROTO_NONE: \
478 case PROTO_UDP: \
479 case PROTO_TCP: \
480 case PROTO_TLS: \
481 case PROTO_WSS: \
482 new_len+=3; \
483 break; \
484 case PROTO_SCTP: \
485 new_len+=4; \
486 break; \
487 case PROTO_WS: \
488 new_len+=2; \
489 break; \
490 default: \
491 LM_CRIT("unknown proto %d\n", \
492 msg->rcv.bind_address->proto); \
493 }\
494 } else \
495 LM_BUG("null bind address 3"); \
496 break; \

Callers 3

msg_translator.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected