37#include <sys/kernel.h>
38#include <sys/module.h>
64 if (ah->
dport == NULL || ah->
sport == NULL || ah->
lnk == NULL)
154#define REG_MSG 0x00000001
155#define IP_PORT_MSG 0x00000002
156#define OPNRCVCH_ACK 0x00000022
157#define START_MEDIATX 0x0000008a
221 tc->th_sum = TcpChecksum(pip);
229 struct ip *pip,
struct tcphdr *tc,
230 struct alias_link *lnk, u_int32_t localIpAddr,
264 tc->th_sum = TcpChecksum(pip);
271 struct ip *pip,
struct tcphdr *tc,
272 struct alias_link *lnk, u_int32_t * localIpAddr,
282 *localIpAddr = (u_int32_t)opnrcvch_ack->
ipAddr;
283 localPort = opnrcvch_ack->
port;
287 htons((u_short) opnrcvch_ack->
port), 0,
296 tc->th_sum = TcpChecksum(pip);
304 size_t hlen, tlen, dlen;
306 u_int32_t msgId, t, len, lip;
308 size_t orig_len, skinny_hdr_len =
sizeof(
struct skinny_header);
312 tc = (
struct tcphdr *)ip_next(pip);
313 hlen = (pip->
ip_hl + tc->th_off) << 2;
314 tlen = ntohs(pip->
ip_len);
326 else if (ntohs(tc->th_sport) == la->
skinnyPort)
331 "PacketAlias/Skinny: Invalid port number, not a Skinny packet\n");
344 while (dlen >= skinny_hdr_len) {
349 if (t > orig_len || t > dlen) {
352 "PacketAlias/Skinny: Not a skinny packet, invalid length \n");
363 "PacketAlias/Skinny: Not a skinny packet, bad registration message\n");
370 "PacketAlias/Skinny: Received a register message");
381 "PacketAlias/Skinny: Not a skinny packet, port message\n");
387 "PacketAlias/Skinny: Received ipport message\n");
399 "PacketAlias/Skinny: Not a skinny packet, packet,OpnRcvChnAckMsg\n");
405 "PacketAlias/Skinny: Received open rcv channel msg\n");
417 "PacketAlias/Skinny: Not a skinny packet,StartMediaTx Message\n");
424 "PacketAlias/Skinny: received a"
425 " packet,StartMediaTx Message before"
426 " packet,OpnRcvChnAckMsg\n"
433 "PacketAlias/Skinny: Received start media trans msg\n");
443 dlen -= len + (skinny_hdr_len -
sizeof(
msgId));
u_short GetAliasPort(struct alias_link *lnk)
struct in_addr GetAliasAddress(struct alias_link *lnk)
struct alias_link * FindUdpTcpOut(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, u_short src_port, u_short dst_port, u_char proto, int create)
int LibAliasAttachHandlers(struct proto_handler *p)
int LibAliasDetachHandlers(struct proto_handler *p)
static int mod_handler(module_t mod, int type, void *data)
static int alias_skinny_opnrcvch_ack(struct libalias *la, struct OpenReceiveChannelAck *opnrcvch_ack, struct ip *pip, struct tcphdr *tc, struct alias_link *lnk, u_int32_t *localIpAddr, ConvDirection direction)
DECLARE_MODULE(alias_skinny, alias_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND)
static void AliasHandleSkinny(struct libalias *, struct ip *, struct alias_link *)
static int fingerprint(struct libalias *la, struct alias_data *ah)
static moduledata_t alias_mod
MODULE_DEPEND(alias_skinny, libalias, 1, 1, 1)
static int alias_skinny_startmedia(struct StartMediaTransmission *start_media, struct ip *pip, struct tcphdr *tc, struct alias_link *lnk, u_int32_t localIpAddr, ConvDirection direction)
static int alias_skinny_port_msg(struct IpPortMessage *port_msg, struct ip *pip, struct tcphdr *tc, struct alias_link *lnk, ConvDirection direction)
static int protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
static int alias_skinny_reg_msg(struct RegisterMessage *reg_msg, struct ip *pip, struct tcphdr *tc, struct alias_link *lnk, ConvDirection direction)
struct proto_handler handlers[]
MODULE_VERSION(alias_skinny, 1)
u_int32_t passThruPartyID