Functions

sip_msg_clone.c File Reference

SIP-router core :: sip message shared memory cloner. More...

#include "sip_msg_clone.h"
#include "dprint.h"
#include "mem/mem.h"
#include "data_lump.h"
#include "data_lump_rpl.h"
#include "ut.h"
#include "parser/digest/digest.h"
#include "parser/parse_to.h"
#include "atomic_ops.h"
Include dependency graph for sip_msg_clone.c:

Go to the source code of this file.

Functions


Detailed Description

Module: SIP-router core

Definition in file sip_msg_clone.c.


Function Documentation

int msg_lump_cloner ( struct sip_msg pkg_msg,
struct lump **  add_rm,
struct lump **  body_lumps,
struct lump_rpl **  reply_lump 
)

A new memory block is allocated for the lumps (the lumps will point into it). Note: the new memory block is linked to add_rm if at least one data lump is set, else it is linked to body_lumps if at least one body lump is set, otherwise it is linked to shm_msg->reply_lump.

Parameters:
pkg_msg - sip msg whoes lumps will be cloned
add_rm - result parameter, filled with the list of cloned add_rm lumps (corresp. to msg->add_rm)
body_lumps - result parameter, filled with the list of cloned body lumps (corresp. to msg->body_lumps)
reply_lump - result parameter, filled with the list of cloned reply lumps (corresp. to msg->reply_lump)
Returns:
0 or 1 on success: 0 - lumps cloned), 1 - nothing to do and -1 on error

Definition at line 947 of file sip_msg_clone.c.

References sip_msg::add_rm, sip_msg::body_lumps, and sip_msg::reply_lump.

Referenced by save_msg_lumps().

Here is the caller graph for this function:

struct sip_msg* sip_msg_shm_clone ( struct sip_msg org_msg,
int *  sip_msg_len,
int  clone_lumps 
) [read]

org_msg is cloned along with most of its headers and lumps into one shm memory block (so that a shm_free() on the result will free everything)

Returns:
shm malloced sip_msg on success, 0 on error Warning: Cloner does not clone all hdr_field headers (From, To, etc.).

Definition at line 377 of file sip_msg_clone.c.

References sip_msg::add_rm, hdr_field::body, sip_msg::body_lumps, sip_msg::buf, contact, sip_msg::dst_uri, sip_msg::eoh, sip_msg::first_line, HDR_ACCEPT_T, HDR_ACCEPTCONTACT_T, HDR_ACCEPTLANGUAGE_T, HDR_ALLOW_T, HDR_ALLOWEVENTS_T, HDR_AUTHORIZATION_T, HDR_CALLID_T, HDR_CONTACT_T, HDR_CONTENTDISPOSITION_T, HDR_CONTENTENCODING_T, HDR_CONTENTLENGTH_T, HDR_CONTENTTYPE_T, HDR_CSEQ_T, HDR_DATE_T, HDR_DIVERSION_T, HDR_EOH_T, HDR_ERROR_T, HDR_EVENT_T, HDR_EXPIRES_T, HDR_FROM_T, HDR_IDENTITY_INFO_T, HDR_IDENTITY_T, HDR_MAXFORWARDS_T, HDR_MIN_SE_T, HDR_ORGANIZATION_T, HDR_OTHER_T, HDR_PAI_T, HDR_PATH_T, HDR_PPI_T, HDR_PRIORITY_T, HDR_PRIVACY_T, HDR_PROXY_AUTHENTICATE_T, HDR_PROXYAUTH_T, HDR_PROXYREQUIRE_T, HDR_REASON_T, HDR_RECORDROUTE_T, HDR_REFER_TO_T, HDR_REFERREDBY_T, HDR_REJECTCONTACT_T, HDR_REQUESTDISPOSITION_T, HDR_REQUIRE_T, HDR_RETRY_AFTER_T, HDR_ROUTE_T, HDR_RPID_T, HDR_SERVER_T, HDR_SESSIONEXPIRES_T, HDR_SIPIFMATCH_T, HDR_SUBJECT_T, HDR_SUBSCRIPTION_STATE_T, HDR_SUPPORTED_T, HDR_TO_T, HDR_UNSUPPORTED_T, HDR_USERAGENT_T, HDR_VIA2_T, HDR_VIA_T, HDR_WWW_AUTHENTICATE_T, sip_msg::headers, sip_msg::last_header, _str::len, sip_msg::len, sip_msg::msg_flags, hdr_field::name, sip_msg::new_uri, hdr_field::next, hdr_field::parsed, sip_msg::parsed_orig_ruri, sip_msg::parsed_uri, record_route(), sip_msg::reply_lump, _str::s, hdr_field::type, sip_msg::unparsed, sip_msg::via1, and sip_msg::via2.

Referenced by rpc_delayed_ctx_new(), and sip_msg_cloner().

Here is the call graph for this function:

Here is the caller graph for this function: