Lines Matching refs:ip

131 #include <netinet/ip.h>
185 static void TcpMonitorIn(struct ip *, struct alias_link *);
187 static void TcpMonitorOut(struct ip *, struct alias_link *);
191 TcpMonitorIn(struct ip *pip, struct alias_link *lnk)
212 TcpMonitorOut(struct ip *pip, struct alias_link *lnk)
277 static int IcmpAliasIn1(struct libalias *, struct ip *);
278 static int IcmpAliasIn2(struct libalias *, struct ip *);
279 static int IcmpAliasIn(struct libalias *, struct ip *);
281 static int IcmpAliasOut1(struct libalias *, struct ip *, int create);
282 static int IcmpAliasOut2(struct libalias *, struct ip *);
283 static int IcmpAliasOut(struct libalias *, struct ip *, int create);
285 static int ProtoAliasIn(struct libalias *, struct ip *);
286 static int ProtoAliasOut(struct libalias *, struct ip *, int create);
288 static int UdpAliasIn(struct libalias *, struct ip *);
289 static int UdpAliasOut(struct libalias *, struct ip *, int create);
291 static int TcpAliasIn(struct libalias *, struct ip *);
292 static int TcpAliasOut(struct libalias *, struct ip *, int, int create);
296 IcmpAliasIn1(struct libalias *la, struct ip *pip)
342 IcmpAliasIn2(struct libalias *la, struct ip *pip)
349 struct ip *ip;
358 ip = &ic->icmp_ip;
360 ud = (struct udphdr *)ip_next(ip);
361 tc = (struct tcphdr *)ip_next(ip);
362 ic2 = (struct icmp *)ip_next(ip);
364 if (ip->ip_p == IPPROTO_UDP)
365 lnk = FindUdpTcpIn(la, ip->ip_dst, ip->ip_src,
368 else if (ip->ip_p == IPPROTO_TCP)
369 lnk = FindUdpTcpIn(la, ip->ip_dst, ip->ip_src,
372 else if (ip->ip_p == IPPROTO_ICMP) {
374 lnk = FindIcmpIn(la, ip->ip_dst, ip->ip_src, ic2->icmp_id, 0);
381 if (ip->ip_p == IPPROTO_UDP || ip->ip_p == IPPROTO_TCP) {
390 accumulate = twowords(&ip->ip_src);
395 accumulate2 += ip->ip_sum;
396 ADJUST_CHECKSUM(accumulate, ip->ip_sum);
397 accumulate2 -= ip->ip_sum;
407 ip->ip_src = original_address;
409 } else if (ip->ip_p == IPPROTO_ICMP) {
418 accumulate = twowords(&ip->ip_src);
423 accumulate2 += ip->ip_sum;
424 ADJUST_CHECKSUM(accumulate, ip->ip_sum);
425 accumulate2 -= ip->ip_sum;
435 ip->ip_src = original_address;
445 IcmpAliasIn(struct libalias *la, struct ip *pip)
481 IcmpAliasOut1(struct libalias *la, struct ip *pip, int create)
526 IcmpAliasOut2(struct libalias *la, struct ip *pip)
532 struct ip *ip;
540 ip = &ic->icmp_ip;
542 ud = (struct udphdr *)ip_next(ip);
543 tc = (struct tcphdr *)ip_next(ip);
544 ic2 = (struct icmp *)ip_next(ip);
546 if (ip->ip_p == IPPROTO_UDP)
547 lnk = FindUdpTcpOut(la, ip->ip_dst, ip->ip_src,
550 else if (ip->ip_p == IPPROTO_TCP)
551 lnk = FindUdpTcpOut(la, ip->ip_dst, ip->ip_src,
554 else if (ip->ip_p == IPPROTO_ICMP) {
556 lnk = FindIcmpOut(la, ip->ip_dst, ip->ip_src, ic2->icmp_id, 0);
563 if (ip->ip_p == IPPROTO_UDP || ip->ip_p == IPPROTO_TCP) {
572 accumulate = twowords(&ip->ip_dst);
582 if (pip->ip_src.s_addr == ip->ip_dst.s_addr) {
589 ip->ip_dst = alias_address;
591 } else if (ip->ip_p == IPPROTO_ICMP) {
600 accumulate = twowords(&ip->ip_dst);
610 if (pip->ip_src.s_addr == ip->ip_dst.s_addr) {
617 ip->ip_dst = alias_address;
627 IcmpAliasOut(struct libalias *la, struct ip *pip, int create)
665 ProtoAliasIn(struct libalias *la, struct ip *pip)
698 ProtoAliasOut(struct libalias *la, struct ip *pip, int create)
732 UdpAliasIn(struct libalias *la, struct ip *pip)
797 UdpAliasOut(struct libalias *la, struct ip *pip, int create)
858 TcpAliasIn(struct libalias *la, struct ip *pip)
977 TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create)
1104 static int FragmentIn(struct libalias *, struct ip *);
1105 static int FragmentOut(struct libalias *, struct ip *);
1109 FragmentIn(struct libalias *la, struct ip *pip)
1130 FragmentOut(struct libalias *la, struct ip *pip)
1166 struct ip *pip;
1169 pip = (struct ip *)ptr;
1186 struct ip *pip;
1189 pip = (struct ip *)ptr;
1211 struct ip *pip;
1212 struct ip *fpip;
1216 pip = (struct ip *)ptr;
1217 fpip = (struct ip *)ptr_fragment;
1248 struct ip *pip;
1263 pip = (struct ip *)ptr;
1383 struct ip *pip;
1393 pip = (struct ip *)ptr;
1475 struct ip *pip;
1483 pip = (struct ip *)ptr;