diff options
author | phk <phk@FreeBSD.org> | 2004-01-17 10:52:21 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-01-17 10:52:21 +0000 |
commit | 7948e91c15e85d387bf8070d18fd9257a7d982be (patch) | |
tree | c6f9109d165b87ec210bad09db4698bcf1e09e3d /lib/libalias/alias_skinny.c | |
parent | b8698f2968ee8eae55e888c1a3ec985218257e28 (diff) | |
download | FreeBSD-src-7948e91c15e85d387bf8070d18fd9257a7d982be.zip FreeBSD-src-7948e91c15e85d387bf8070d18fd9257a7d982be.tar.gz |
Mostly mechanical rework of libalias:
Makes it possible to have multiple packet aliasing instances in a
single process by moving all static and global variables into an
instance structure called "struct libalias".
Redefine a new API based on s/PacketAlias/LibAlias/g
Add new "instance" argument to all functions in the new API.
Implement old API in terms of the new API.
Diffstat (limited to 'lib/libalias/alias_skinny.c')
-rw-r--r-- | lib/libalias/alias_skinny.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libalias/alias_skinny.c b/lib/libalias/alias_skinny.c index 055c05b..d674893 100644 --- a/lib/libalias/alias_skinny.c +++ b/lib/libalias/alias_skinny.c @@ -173,7 +173,7 @@ alias_skinny_port_msg(struct IpPortMessage *port_msg, struct ip *pip, } static int -alias_skinny_opnrcvch_ack(struct OpenReceiveChannelAck *opnrcvch_ack, +alias_skinny_opnrcvch_ack(struct libalias *la, struct OpenReceiveChannelAck *opnrcvch_ack, struct ip * pip, struct tcphdr *tc, struct alias_link *link, u_int32_t *localIpAddr, ConvDirection direction) @@ -186,7 +186,7 @@ alias_skinny_opnrcvch_ack(struct OpenReceiveChannelAck *opnrcvch_ack, localPort = opnrcvch_ack->port; null_addr.s_addr = INADDR_ANY; - opnrcv_link = FindUdpTcpOut(pip->ip_src, null_addr, + opnrcv_link = FindUdpTcpOut(la, pip->ip_src, null_addr, htons((u_short) opnrcvch_ack->port), 0, IPPROTO_UDP, 1); opnrcvch_ack->ipAddr = (u_int32_t) GetAliasAddress(opnrcv_link).s_addr; @@ -199,7 +199,7 @@ alias_skinny_opnrcvch_ack(struct OpenReceiveChannelAck *opnrcvch_ack, } void -AliasHandleSkinny(struct ip *pip, struct alias_link *link) +AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *link) { int hlen, tlen, dlen; struct tcphdr *tc; @@ -220,9 +220,9 @@ AliasHandleSkinny(struct ip *pip, struct alias_link *link) * handle the scenario where the call manager is on the inside, and * the calling phone is on the global outside. */ - if (ntohs(tc->th_dport) == skinnyPort) { + if (ntohs(tc->th_dport) == la->skinnyPort) { direction = ClientToServer; - } else if (ntohs(tc->th_sport) == skinnyPort) { + } else if (ntohs(tc->th_sport) == la->skinnyPort) { direction = ServerToClient; } else { #ifdef DEBUG @@ -306,7 +306,7 @@ AliasHandleSkinny(struct ip *pip, struct alias_link *link) "PacketAlias/Skinny: Received open rcv channel msg\n"); #endif opnrcvchn_ack = (struct OpenReceiveChannelAck *) & sd->msgId; - alias_skinny_opnrcvch_ack(opnrcvchn_ack, pip, tc, link, &lip, direction); + alias_skinny_opnrcvch_ack(la, opnrcvchn_ack, pip, tc, link, &lip, direction); } break; case START_MEDIATX: |