Bläddra i källkod

nathelper: clang format the code

Daniel-Constantin Mierla 7 år sedan
förälder
incheckning
bcc5a66815

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 236 - 240
src/modules/nathelper/nathelper.c


+ 11 - 6
src/modules/nathelper/nathelper.h

@@ -17,10 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
- * History:
- * ---------
- * 2007-04-13   splitted from nathelper.c (ancuta)
-*/
+ */
 
 
 #ifndef _NATHELPER_NATHELPER_H
@@ -29,7 +26,15 @@
 #include "../../core/str.h"
 
 /* Handy macros */
-#define STR2IOVEC(sx, ix)       do {(ix).iov_base = (sx).s; (ix).iov_len = (sx).len;} while(0)
-#define SZ2IOVEC(sx, ix)        do {(ix).iov_base = (sx); (ix).iov_len = strlen(sx);} while(0)
+#define STR2IOVEC(sx, ix)        \
+	do {                         \
+		(ix).iov_base = (sx).s;  \
+		(ix).iov_len = (sx).len; \
+	} while(0)
+#define SZ2IOVEC(sx, ix)           \
+	do {                           \
+		(ix).iov_base = (sx);      \
+		(ix).iov_len = strlen(sx); \
+	} while(0)
 
 #endif

+ 84 - 87
src/modules/nathelper/nhelpr_funcs.c

@@ -44,20 +44,20 @@
 
 #define READ(val) \
 	(*(val + 0) + (*(val + 1) << 8) + (*(val + 2) << 16) + (*(val + 3) << 24))
-#define advance(_ptr,_n,_str,_error) \
-	do{\
-		if ((_ptr)+(_n)>(_str).s+(_str).len)\
-			goto _error;\
-		(_ptr) = (_ptr) + (_n);\
-	}while(0);
-#define one_of_16( _x , _t ) \
-	(_x==_t[0]||_x==_t[15]||_x==_t[8]||_x==_t[2]||_x==_t[3]||_x==_t[4]\
-	||_x==_t[5]||_x==_t[6]||_x==_t[7]||_x==_t[1]||_x==_t[9]||_x==_t[10]\
-	||_x==_t[11]||_x==_t[12]||_x==_t[13]||_x==_t[14])
-#define one_of_8( _x , _t ) \
-	(_x==_t[0]||_x==_t[7]||_x==_t[1]||_x==_t[2]||_x==_t[3]||_x==_t[4]\
-	||_x==_t[5]||_x==_t[6])
-
+#define advance(_ptr, _n, _str, _error)           \
+	do {                                          \
+		if((_ptr) + (_n) > (_str).s + (_str).len) \
+			goto _error;                          \
+		(_ptr) = (_ptr) + (_n);                   \
+	} while(0);
+#define one_of_16(_x, _t)                                                     \
+	(_x == _t[0] || _x == _t[15] || _x == _t[8] || _x == _t[2] || _x == _t[3] \
+			|| _x == _t[4] || _x == _t[5] || _x == _t[6] || _x == _t[7]       \
+			|| _x == _t[1] || _x == _t[9] || _x == _t[10] || _x == _t[11]     \
+			|| _x == _t[12] || _x == _t[13] || _x == _t[14])
+#define one_of_8(_x, _t)                                                     \
+	(_x == _t[0] || _x == _t[7] || _x == _t[1] || _x == _t[2] || _x == _t[3] \
+			|| _x == _t[4] || _x == _t[5] || _x == _t[6])
 
 
 /**
@@ -68,6 +68,7 @@
  */
 int check_content_type(struct sip_msg *msg)
 {
+	/* clang-format off */
 	static unsigned int appl[16] = {
 		0x6c707061/*appl*/,0x6c707041/*Appl*/,0x6c705061/*aPpl*/,
 		0x6c705041/*APpl*/,0x6c507061/*apPl*/,0x6c507041/*ApPl*/,
@@ -90,55 +91,55 @@ int check_content_type(struct sip_msg *msg)
 		0x00706473/*sdp_*/,0x00706453/*Sdp_*/,0x00704473/*sDp_*/,
 		0x00704453/*SDp_*/,0x00506473/*sdP_*/,0x00506453/*SdP_*/,
 		0x00504473/*sDP_*/,0x00504453/*SDP_*/};
-	str           str_type;
-	unsigned int  x;
-	char          *p;
+	/* clang-format on */
+	str str_type;
+	unsigned int x;
+	char *p;
 
-	if (!msg->content_type)
-	{
+	if(!msg->content_type) {
 		LM_WARN("the header Content-TYPE is absent!"
-			"let's assume the content is text/plain ;-)\n");
+				"let's assume the content is text/plain ;-)\n");
 		return 1;
 	}
 
-	trim_len(str_type.len,str_type.s,msg->content_type->body);
-	if (str_type.len>=15 && (*str_type.s=='m' || *str_type.s=='M')
+	trim_len(str_type.len, str_type.s, msg->content_type->body);
+	if(str_type.len >= 15 && (*str_type.s == 'm' || *str_type.s == 'M')
 			&& strncasecmp(str_type.s, "multipart/mixed", 15) == 0) {
 		return 2;
 	}
 	p = str_type.s;
-	advance(p,4,str_type,error_1);
-	x = READ(p-4);
-	if (!one_of_16(x,appl))
+	advance(p, 4, str_type, error_1);
+	x = READ(p - 4);
+	if(!one_of_16(x, appl))
 		goto other;
-	advance(p,4,str_type,error_1);
-	x = READ(p-4);
-	if (!one_of_16(x,icat))
+	advance(p, 4, str_type, error_1);
+	x = READ(p - 4);
+	if(!one_of_16(x, icat))
 		goto other;
-	advance(p,3,str_type,error_1);
-	x = READ(p-3) & 0x00ffffff;
-	if (!one_of_8(x,ion_))
+	advance(p, 3, str_type, error_1);
+	x = READ(p - 3) & 0x00ffffff;
+	if(!one_of_8(x, ion_))
 		goto other;
 
 	/* skip spaces and tabs if any */
-	while (*p==' ' || *p=='\t')
-		advance(p,1,str_type,error_1);
-	if (*p!='/')
-	{
+	while(*p == ' ' || *p == '\t')
+		advance(p, 1, str_type, error_1);
+	if(*p != '/') {
 		LM_ERR("no / found after primary type\n");
 		goto error;
 	}
-	advance(p,1,str_type,error_1);
-	while ((*p==' ' || *p=='\t') && p+1<str_type.s+str_type.len)
-		advance(p,1,str_type,error_1);
+	advance(p, 1, str_type, error_1);
+	while((*p == ' ' || *p == '\t') && p + 1 < str_type.s + str_type.len)
+		advance(p, 1, str_type, error_1);
 
-	advance(p,3,str_type,error_1);
-	x = READ(p-3) & 0x00ffffff;
-	if (!one_of_8(x,sdp_))
+	advance(p, 3, str_type, error_1);
+	x = READ(p - 3) & 0x00ffffff;
+	if(!one_of_8(x, sdp_))
 		goto other;
 
-	if (*p==';'||*p==' '||*p=='\t'||*p=='\n'||*p=='\r'||*p==0) {
-		LM_DBG("type <%.*s> found valid\n", (int)(p-str_type.s), str_type.s);
+	if(*p == ';' || *p == ' ' || *p == '\t' || *p == '\n' || *p == '\r'
+			|| *p == 0) {
+		LM_DBG("type <%.*s> found valid\n", (int)(p - str_type.s), str_type.s);
 		return 1;
 	} else {
 		LM_ERR("bad end for type!\n");
@@ -157,7 +158,7 @@ other:
 /*
  * Get message body and check Content-Type header field
  */
-int extract_body(struct sip_msg *msg, str *body )
+int extract_body(struct sip_msg *msg, str *body)
 {
 	char c;
 	int skip;
@@ -168,7 +169,7 @@ int extract_body(struct sip_msg *msg, str *body )
 	unsigned int mime;
 
 	body->s = get_body(msg);
-	if (body->s==0) {
+	if(body->s == 0) {
 		LM_ERR("failed to get the message body\n");
 		goto error;
 	}
@@ -178,18 +179,18 @@ int extract_body(struct sip_msg *msg, str *body )
 	 * parcing as get_body() parsed all headers and Conten-Length
 	 * body header is automaticaly parsed when found.
 	 */
-	if (msg->content_length==0) {
+	if(msg->content_length == 0) {
 		LM_ERR("failed to get the content length in message\n");
 		goto error;
 	}
 
 	body->len = get_content_length(msg);
-	if (body->len==0) {
+	if(body->len == 0) {
 		LM_ERR("message body has length zero\n");
 		goto error;
 	}
 
-	if (body->len + body->s > msg->buf + msg->len) {
+	if(body->len + body->s > msg->buf + msg->len) {
 		LM_ERR("content-length exceeds packet-length by %d\n",
 				(int)((body->len + body->s) - (msg->buf + msg->len)));
 		goto error;
@@ -198,60 +199,57 @@ int extract_body(struct sip_msg *msg, str *body )
 	/* no need for parse_headers(msg, EOH), get_body will
 	 * parse everything */
 	/*is the content type correct?*/
-	if((ret = check_content_type(msg))==-1)
-	{
+	if((ret = check_content_type(msg)) == -1) {
 		LM_ERR("content type mismatching\n");
 		goto error;
 	}
 
-	if(ret!=2)
+	if(ret != 2)
 		goto done;
 
 	/* multipart body */
-	if(get_mixed_part_delimiter(&msg->content_type->body,&mpdel) < 0) {
+	if(get_mixed_part_delimiter(&msg->content_type->body, &mpdel) < 0) {
 		goto error;
 	}
-	p1 = find_sdp_line_delimiter(body->s, body->s+body->len, mpdel);
-	if (p1 == NULL) {
+	p1 = find_sdp_line_delimiter(body->s, body->s + body->len, mpdel);
+	if(p1 == NULL) {
 		LM_ERR("empty multipart content\n");
 		return -1;
 	}
-	p2=p1;
+	p2 = p1;
 	c = 0;
-	for(;;)
-	{
+	for(;;) {
 		p1 = p2;
-		if (p1 == NULL || p1 >= body->s+body->len)
+		if(p1 == NULL || p1 >= body->s + body->len)
 			break; /* No parts left */
-		p2 = find_next_sdp_line_delimiter(p1, body->s+body->len,
-				mpdel, body->s+body->len);
+		p2 = find_next_sdp_line_delimiter(
+				p1, body->s + body->len, mpdel, body->s + body->len);
 		/* p2 is text limit for application parsing */
 		rest = eat_line(p1 + mpdel.len + 2, p2 - p1 - mpdel.len - 2);
-		if ( rest > p2 ) {
-			LM_ERR("Unparsable <%.*s>\n", (int)(p1-p1), p1);
+		if(rest > p2) {
+			LM_ERR("Unparsable <%.*s>\n", (int)(p1 - p1), p1);
 			return -1;
 		}
-		while( rest<p2 ) {
-			memset(&hf,0, sizeof(struct hdr_field));
+		while(rest < p2) {
+			memset(&hf, 0, sizeof(struct hdr_field));
 			rest = get_sdp_hdr_field(rest, p2, &hf);
-			if(hf.type==HDR_EOH_T)
+			if(hf.type == HDR_EOH_T)
 				break;
-			if(hf.type==HDR_ERROR_T)
+			if(hf.type == HDR_ERROR_T)
 				return -1;
-			if(hf.type==HDR_CONTENTTYPE_T) {
-				if(decode_mime_type(hf.body.s, hf.body.s + hf.body.len,
-						&mime)==NULL)
+			if(hf.type == HDR_CONTENTTYPE_T) {
+				if(decode_mime_type(hf.body.s, hf.body.s + hf.body.len, &mime)
+						== NULL)
 					return -1;
-				if (((((unsigned int)mime)>>16) == TYPE_APPLICATION)
-						&& ((mime&0x00ff) == SUBTYPE_SDP)) {
+				if(((((unsigned int)mime) >> 16) == TYPE_APPLICATION)
+						&& ((mime & 0x00ff) == SUBTYPE_SDP)) {
 					c = 1;
 				}
 			}
 		} /* end of while */
-		if(c==1)
-		{
+		if(c == 1) {
 			body->s = rest;
-			body->len = p2-rest;
+			body->len = p2 - rest;
 			goto done;
 		}
 	}
@@ -260,12 +258,12 @@ error:
 	return -1;
 
 done:
-	for (skip = 0; skip < body->len; skip++) {
+	for(skip = 0; skip < body->len; skip++) {
 		c = body->s[body->len - skip - 1];
-		if (c != '\r' && c != '\n')
+		if(c != '\r' && c != '\n')
 			break;
 	}
-	if (skip == body->len) {
+	if(skip == body->len) {
 		LM_ERR("empty body");
 		goto error;
 	}
@@ -283,24 +281,23 @@ done:
 /*
  * Extract URI from the Contact header field
  */
-int
-get_contact_uri(struct sip_msg* _m, struct sip_uri *uri, contact_t** _c)
+int get_contact_uri(struct sip_msg *_m, struct sip_uri *uri, contact_t **_c)
 {
-	if ((parse_headers(_m, HDR_CONTACT_F, 0) == -1) || !_m->contact)
+	if((parse_headers(_m, HDR_CONTACT_F, 0) == -1) || !_m->contact)
 		return -1;
-	if (!_m->contact->parsed && parse_contact(_m->contact) < 0) {
+	if(!_m->contact->parsed && parse_contact(_m->contact) < 0) {
 		LM_ERR("failed to parse Contact body\n");
 		return -1;
 	}
-	*_c = ((contact_body_t*)_m->contact->parsed)->contacts;
-	if (*_c == NULL)
+	*_c = ((contact_body_t *)_m->contact->parsed)->contacts;
+	if(*_c == NULL)
 		/* no contacts found */
 		return -1;
 
-	if (parse_uri((*_c)->uri.s, (*_c)->uri.len, uri) < 0 || uri->host.len <= 0) {
-		LM_ERR("failed to parse Contact URI [%.*s]\n",
-			(*_c)->uri.len, ((*_c)->uri.s)?(*_c)->uri.s:"");
+	if(parse_uri((*_c)->uri.s, (*_c)->uri.len, uri) < 0 || uri->host.len <= 0) {
+		LM_ERR("failed to parse Contact URI [%.*s]\n", (*_c)->uri.len,
+				((*_c)->uri.s) ? (*_c)->uri.s : "");
 		return -1;
 	}
 	return 0;
-}
+}

+ 3 - 3
src/modules/nathelper/nhelpr_funcs.h

@@ -21,14 +21,14 @@
 
 
 #ifndef _NHLPR_FUNCS_H
-#define  _NHLPR_FUNCS_H
+#define _NHLPR_FUNCS_H
 
 #include "../../core/str.h"
 #include "../../core/parser/msg_parser.h"
 #include "../../core/parser/contact/contact.h"
 
-int extract_body(struct sip_msg * , str *);
-int check_content_type(struct sip_msg * );
+int extract_body(struct sip_msg *, str *);
+int check_content_type(struct sip_msg *);
 int get_contact_uri(struct sip_msg *, struct sip_uri *, contact_t **);
 
 #endif

+ 80 - 81
src/modules/nathelper/sip_pinger.h

@@ -35,20 +35,19 @@
 #define MAX_SIPPING_SIZE 65536
 
 /* helping macros for building SIP PING ping request */
-#define append_fix( _p, _s) \
-	do {\
-		memcpy(_p, _s, sizeof(_s)-1);\
-		_p += sizeof(_s)-1;\
-	}while(0)
+#define append_fix(_p, _s)              \
+	do {                                \
+		memcpy(_p, _s, sizeof(_s) - 1); \
+		_p += sizeof(_s) - 1;           \
+	} while(0)
 
 /* info used to generate SIP ping requests */
-static int  sipping_fromtag = 0;
+static int sipping_fromtag = 0;
 static char sipping_callid_buf[8];
-static int  sipping_callid_cnt = 0;
-static str  sipping_callid = {0,0};
-static str  sipping_from = STR_NULL;
-static str  sipping_method = str_init("OPTIONS");
-
+static int sipping_callid_cnt = 0;
+static str sipping_callid = {0, 0};
+static str sipping_from = STR_NULL;
+static str sipping_method = str_init("OPTIONS");
 
 
 static void init_sip_ping(void)
@@ -61,42 +60,45 @@ static void init_sip_ping(void)
 	/* callid fix part - hexa string */
 	len = 8;
 	p = sipping_callid_buf;
-	int2reverse_hex( &p, &len, rand() );
+	int2reverse_hex(&p, &len, rand());
 	sipping_callid.s = sipping_callid_buf;
-	sipping_callid.len = 8-len;
+	sipping_callid.len = 8 - len;
 	/* callid counter part */
 	sipping_callid_cnt = rand();
 }
 
 
-
 static int sipping_rpl_filter(struct sip_msg *rpl)
 {
-	struct cseq_body* cseq_b;
+	struct cseq_body *cseq_b;
 
 	/* first check number of vias -> must be only one */
-	if (parse_headers( rpl, HDR_VIA2_F, 0 )==-1 || (rpl->via2!=0))
+	if(parse_headers(rpl, HDR_VIA2_F, 0) == -1 || (rpl->via2 != 0))
 		goto skip;
 
 	/* check the method -> we need CSeq header */
-	if ( (!rpl->cseq && parse_headers(rpl,HDR_CSEQ_F,0)!=0) || rpl->cseq==0 ) {
+	if((!rpl->cseq && parse_headers(rpl, HDR_CSEQ_F, 0) != 0)
+			|| rpl->cseq == 0) {
 		LM_ERR("failed to parse CSeq\n");
 		goto error;
 	}
-	cseq_b = (struct cseq_body*)rpl->cseq->parsed;
-	if (cseq_b->method.len!=sipping_method.len ||
-	strncmp(cseq_b->method.s,sipping_method.s,sipping_method.len)!=0)
+	cseq_b = (struct cseq_body *)rpl->cseq->parsed;
+	if(cseq_b->method.len != sipping_method.len
+			|| strncmp(cseq_b->method.s, sipping_method.s, sipping_method.len)
+					   != 0)
 		goto skip;
 
 	/* check constant part of callid */
-	if ( (!rpl->callid && parse_headers(rpl,HDR_CALLID_F,0)!=0) ||
-	rpl->callid==0 ) {
+	if((!rpl->callid && parse_headers(rpl, HDR_CALLID_F, 0) != 0)
+			|| rpl->callid == 0) {
 		LM_ERR("failed to parse Call-ID\n");
 		goto error;
 	}
-	if ( rpl->callid->body.len<=sipping_callid.len+1 ||
-	strncmp(rpl->callid->body.s,sipping_callid.s,sipping_callid.len)!=0 ||
-	rpl->callid->body.s[sipping_callid.len]!='-')
+	if(rpl->callid->body.len <= sipping_callid.len + 1
+			|| strncmp(rpl->callid->body.s, sipping_callid.s,
+					   sipping_callid.len)
+					   != 0
+			|| rpl->callid->body.s[sipping_callid.len] != '-')
 		goto skip;
 
 	LM_DBG("reply for SIP natping filtered\n");
@@ -110,101 +112,98 @@ error:
 }
 
 
-
 /* build the buffer of a SIP ping request */
-static inline char* build_sipping(str *curi, struct socket_info* s, str *path,
-								str *ruid, unsigned int aorhash, int *len_p)
+static inline char *build_sipping(str *curi, struct socket_info *s, str *path,
+		str *ruid, unsigned int aorhash, int *len_p)
 {
-#define s_len(_s) (sizeof(_s)-1)
+#define s_len(_s) (sizeof(_s) - 1)
 #define MAX_BRANCHID 9999999
 #define MIN_BRANCHID 1000000
-#define LEN_BRANCHID 7  /* NOTE: this must be sync with the MX and MIN values !! */
+#define LEN_BRANCHID \
+	7 /* NOTE: this must be sync with the MX and MIN values !! */
 	static char buf[MAX_SIPPING_SIZE];
 	char *p;
 	int len;
 	str vaddr;
 	str vport;
 
-	if(s->useinfo.name.len>0)
+	if(s->useinfo.name.len > 0)
 		vaddr = s->useinfo.name;
 	else
 		vaddr = s->address_str;
 
-	if(s->useinfo.port_no>0)
+	if(s->useinfo.port_no > 0)
 		vport = s->useinfo.port_no_str;
 	else
 		vport = s->port_no_str;
 
-	if ( sipping_method.len + 1 + curi->len + s_len(" SIP/2.0"CRLF) +
-		s_len("Via: SIP/2.0/UDP ") + vaddr.len +
-				((s->address.af==AF_INET6)?2:0) +
-				1 + vport.len + s_len(";branch=z9hG4bK") + LEN_BRANCHID +
-		(path->len ? (s_len(CRLF"Route: ") + path->len) : 0) +
-		s_len(CRLF"From: ") +  sipping_from.len + s_len(";tag=") +
-				ruid->len + 1 + 8 + 1 + 8 +
-		s_len(CRLF"To: ") + curi->len +
-		s_len(CRLF"Call-ID: ") + sipping_callid.len + 1 + 8 + 1 + 8 + 1 +
-				s->address_str.len +
-		s_len(CRLF"CSeq: 1 ") + sipping_method.len +
-		s_len(CRLF"Content-Length: 0" CRLF CRLF)
-			> MAX_SIPPING_SIZE )
-	{
-		LM_ERR("len exceeds %d\n",MAX_SIPPING_SIZE);
+	if(sipping_method.len + 1 + curi->len + s_len(" SIP/2.0" CRLF)
+					+ s_len("Via: SIP/2.0/UDP ") + vaddr.len
+					+ ((s->address.af == AF_INET6) ? 2 : 0) + 1 + vport.len
+					+ s_len(";branch=z9hG4bK") + LEN_BRANCHID
+					+ (path->len ? (s_len(CRLF "Route: ") + path->len) : 0)
+					+ s_len(CRLF "From: ") + sipping_from.len + s_len(";tag=")
+					+ ruid->len + 1 + 8 + 1 + 8 + s_len(CRLF "To: ") + curi->len
+					+ s_len(CRLF "Call-ID: ") + sipping_callid.len + 1 + 8 + 1
+					+ 8 + 1 + s->address_str.len + s_len(CRLF "CSeq: 1 ")
+					+ sipping_method.len
+					+ s_len(CRLF "Content-Length: 0" CRLF CRLF)
+			> MAX_SIPPING_SIZE) {
+		LM_ERR("len exceeds %d\n", MAX_SIPPING_SIZE);
 		return 0;
 	}
 
 	p = buf;
-	append_str( p, sipping_method.s, sipping_method.len);
+	append_str(p, sipping_method.s, sipping_method.len);
 	*(p++) = ' ';
-	append_str( p, curi->s, curi->len);
-	append_fix( p, " SIP/2.0"CRLF"Via: SIP/2.0/UDP ");
-	if (s->address.af == AF_INET6) {	/* Via header IP is a IPv6 reference */
-		append_fix( p, "[");
+	append_str(p, curi->s, curi->len);
+	append_fix(p, " SIP/2.0" CRLF "Via: SIP/2.0/UDP ");
+	if(s->address.af == AF_INET6) { /* Via header IP is a IPv6 reference */
+		append_fix(p, "[");
 	}
-	append_str( p, vaddr.s, vaddr.len);
-	if (s->address.af == AF_INET6) {
-		append_fix( p, "]");
+	append_str(p, vaddr.s, vaddr.len);
+	if(s->address.af == AF_INET6) {
+		append_fix(p, "]");
 	}
 	*(p++) = ':';
-	append_str( p, vport.s, vport.len);
-	append_fix( p, ";branch=z9hG4bK");
-	int2bstr(
-		(long)(rand()/(float)RAND_MAX * (MAX_BRANCHID-MIN_BRANCHID) + MIN_BRANCHID),
-		p+LEN_BRANCHID-INT2STR_MAX_LEN+1, NULL);
+	append_str(p, vport.s, vport.len);
+	append_fix(p, ";branch=z9hG4bK");
+	int2bstr((long)(rand() / (float)RAND_MAX * (MAX_BRANCHID - MIN_BRANCHID)
+					 + MIN_BRANCHID),
+			p + LEN_BRANCHID - INT2STR_MAX_LEN + 1, NULL);
 	p += LEN_BRANCHID;
-	if (path->len) {
-		append_fix( p, CRLF"Route: ");
-		append_str( p, path->s, path->len);
+	if(path->len) {
+		append_fix(p, CRLF "Route: ");
+		append_str(p, path->s, path->len);
 	}
-	append_fix( p, CRLF"From: ");
-	append_str( p, sipping_from.s, sipping_from.len);
-	append_fix( p, ";tag=");
-	append_str( p, ruid->s, ruid->len);
+	append_fix(p, CRLF "From: ");
+	append_str(p, sipping_from.s, sipping_from.len);
+	append_fix(p, ";tag=");
+	append_str(p, ruid->s, ruid->len);
 	*(p++) = '-';
 	len = 8;
-	int2reverse_hex( &p, &len, aorhash );
+	int2reverse_hex(&p, &len, aorhash);
 	*(p++) = '-';
 	len = 8;
-	int2reverse_hex( &p, &len, sipping_fromtag++ );
-	append_fix( p, CRLF"To: ");
-	append_str( p, curi->s, curi->len);
-	append_fix( p, CRLF"Call-ID: ");
-	append_str( p, sipping_callid.s, sipping_callid.len);
+	int2reverse_hex(&p, &len, sipping_fromtag++);
+	append_fix(p, CRLF "To: ");
+	append_str(p, curi->s, curi->len);
+	append_fix(p, CRLF "Call-ID: ");
+	append_str(p, sipping_callid.s, sipping_callid.len);
 	*(p++) = '-';
 	len = 8;
-	int2reverse_hex( &p, &len, sipping_callid_cnt++ );
+	int2reverse_hex(&p, &len, sipping_callid_cnt++);
 	*(p++) = '-';
 	len = 8;
-	int2reverse_hex( &p, &len, get_ticks() );
+	int2reverse_hex(&p, &len, get_ticks());
 	*(p++) = '@';
-	append_str( p, s->address_str.s, s->address_str.len);
-	append_fix( p, CRLF"CSeq: 1 ");
-	append_str( p, sipping_method.s, sipping_method.len);
-	append_fix( p, CRLF"Content-Length: 0" CRLF CRLF);
+	append_str(p, s->address_str.s, s->address_str.len);
+	append_fix(p, CRLF "CSeq: 1 ");
+	append_str(p, sipping_method.s, sipping_method.len);
+	append_fix(p, CRLF "Content-Length: 0" CRLF CRLF);
 
 	*len_p = p - buf;
 	return buf;
 }
 
-
-#endif
+#endif

Vissa filer visades inte eftersom för många filer har ändrats