Module: sip-router
Branch: master
Commit: 62e5680c9dd4eccb0f177415b7624af832c87693
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=62e5680…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jan 11 18:40:57 2012 +0100
lib/kcore: set basic receive info for faked message
- used UDP/IPv4, port 5060 and 127.0.0.1 for src and dst details
---
lib/kcore/faked_msg.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/lib/kcore/faked_msg.c b/lib/kcore/faked_msg.c
index efaba59..824bc32 100644
--- a/lib/kcore/faked_msg.c
+++ b/lib/kcore/faked_msg.c
@@ -39,7 +39,7 @@ int faked_msg_init(void)
/* init faked sip msg */
memcpy(_faked_sip_buf, FAKED_SIP_MSG, FAKED_SIP_MSG_LEN);
_faked_sip_buf[FAKED_SIP_MSG_LEN] = '\0';
-
+
memset(&_faked_msg, 0, sizeof(struct sip_msg));
_faked_msg.buf=_faked_sip_buf;
@@ -53,6 +53,17 @@ int faked_msg_init(void)
LM_ERR("parse_msg failed\n");
return -1;
}
+
+ _faked_msg.rcv.proto = PROTO_UDP;
+ _faked_msg.rcv.src_port = 5060;
+ _faked_msg.rcv.src_ip.u.addr32[0] = 0x7f000001;
+ _faked_msg.rcv.src_ip.af = AF_INET;
+ _faked_msg.rcv.src_ip.len = 4;
+ _faked_msg.rcv.dst_port = 5060;
+ _faked_msg.rcv.dst_ip.u.addr32[0] = 0x7f000001;
+ _faked_msg.rcv.dst_ip.af = AF_INET;
+ _faked_msg.rcv.dst_ip.len = 4;
+
return 0;
}