Module: sip-router
Branch: adubovikov/homer
Commit: 4747dde1929599d3028092eacf0353189b8d0f2b
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4747dde…
Author: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Committer: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Date: Fri Aug 19 17:16:10 2011 +0200
If ser works in IPIP capturing mode, raw_ipip is set to 1, that
point to cut one IP header off.
---
raw_sock.c | 8 +++++++-
raw_sock.h | 1 +
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/raw_sock.c b/raw_sock.c
index 6298da0..b514a87 100644
--- a/raw_sock.c
+++ b/raw_sock.c
@@ -84,6 +84,8 @@
#endif /* __OS_* */
+int raw_ipip = 0; /* set if raw socket is in capture mode for IPIP */
+
/** create and return a raw socket.
* @param proto - protocol used (e.g. IPPROTO_UDP, IPPROTO_RAW)
@@ -319,10 +321,14 @@ int raw_udp4_recv(int rsock, char** buf, int len, union sockaddr_union* from,
if (unlikely(n<0)) goto error;
end=*buf+n;
- if (unlikely(n<(sizeof(struct ip)+sizeof(struct udphdr)))) {
+ if (unlikely(n<((sizeof(struct ip) * raw_ipip ? 2 : 1)+sizeof(struct udphdr)))) {
n=-3;
goto error;
}
+
+ if(raw_ipip)
+ *buf = *buf + sizeof(struct ip);
+
/* FIXME: if initial buffer is aligned, one could skip the memcpy
and directly cast ip and udphdr pointer to the memory */
memcpy(&iph, *buf, sizeof(struct ip));
diff --git a/raw_sock.h b/raw_sock.h
index 6be0aba..868399f 100644
--- a/raw_sock.h
+++ b/raw_sock.h
@@ -39,6 +39,7 @@ struct raw_filter{
char proto;
};
+extern int raw_ipip;
int raw_socket(int proto, struct ip_addr* ip, str* iface, int iphdr_incl);
int raw_udp4_socket(struct ip_addr* ip, str* iface, int iphdr_incl);
Hello,
i need to create a pv_spec_t for an avp, where i only have the name of the avp
in a str (0 terminated). Is there a helper function to do this?
I know pv_parse_spec() exists, but is needs "$avp(name)" as input and is a bit
of a heavy function. I only have "name", and need to get the same pv_spec_t as
if pv_parse_spec() was called with "$avp(name)" as parameter.
--
Greetings,
Alex Hermann
Patches item #3394470, was opened at 2011-08-19 13:40
Message generated for change (Tracker Item Submitted) made by timoreimann
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=3394470&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver 1.5.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Timo Reimann (timoreimann)
Assigned to: Nobody/Anonymous (nobody)
Summary: CDR-based logging (1.5 backport)
Initial Comment:
This patch provides the functionality to produce CDRs from Kamailio.
It is a backport of the code pushed to the Sip-Router master branch on 3. August 2011. Changes affect the following modules:
modules/dialog
modules/acc
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=3394470&group_…
there was recently a commit related to re.subst. looks like it broke
one of my re.substs that used to work before:
$(rb{re.subst,/[\n\r\t]//g})
Aug 18 15:43:54 sip /usr/sbin/sip-proxy[14727]: ERROR: <core> [re.c:235]: ERROR: subst_parser: expression is too short: /[
Aug 18 15:43:54 sip /usr/sbin/sip-proxy[14727]: ERROR: textops [txt_var.c:230]: invalid transformation [subst,/[#012#015#011]//g}] <8>
Aug 18 15:43:54 sip /usr/sbin/sip-proxy[14727]: ERROR: <core> [pvapi.c:1303]: error parsing [{re.subst,/[#012#015#011]//g}]
Aug 18 15:43:54 sip /usr/sbin/sip-proxy[14727]: ERROR: <core> [pvapi.c:698]: bad tr in pvar name "rb"
Aug 18 15:43:54 sip /usr/sbin/sip-proxy[14727]: ERROR: <core> [pvapi.c:724]: invalid parsing in [$(rb{re.subst,/[#012#015#011]//g})>#012] at (4)
my testing is pretty much stuck before this is fixed.
-- juha