Browse code

lib/kcore: set basic receive info for faked message

- used UDP/IPv4, port 5060 and 127.0.0.1 for src and dst details

Daniel-Constantin Mierla authored on 11/01/2012 17:40:57
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@ int faked_msg_init(void)
39 39
 	/* init faked sip msg */
40 40
 	memcpy(_faked_sip_buf, FAKED_SIP_MSG, FAKED_SIP_MSG_LEN);
41 41
 	_faked_sip_buf[FAKED_SIP_MSG_LEN] = '\0';
42
-	
42
+
43 43
 	memset(&_faked_msg, 0, sizeof(struct sip_msg));
44 44
 
45 45
 	_faked_msg.buf=_faked_sip_buf;
... ...
@@ -53,6 +53,17 @@ int faked_msg_init(void)
53 53
 		LM_ERR("parse_msg failed\n");
54 54
 		return -1;
55 55
 	}
56
+
57
+	_faked_msg.rcv.proto = PROTO_UDP;
58
+	_faked_msg.rcv.src_port = 5060;
59
+	_faked_msg.rcv.src_ip.u.addr32[0] = 0x7f000001;
60
+	_faked_msg.rcv.src_ip.af = AF_INET;
61
+	_faked_msg.rcv.src_ip.len = 4;
62
+	_faked_msg.rcv.dst_port = 5060;
63
+	_faked_msg.rcv.dst_ip.u.addr32[0] = 0x7f000001;
64
+	_faked_msg.rcv.dst_ip.af = AF_INET;
65
+	_faked_msg.rcv.dst_ip.len = 4;
66
+
56 67
 	return 0;
57 68
 }
58 69