MCPcopy Create free account
hub / github.com/F-Stack/f-stack / IcmpAliasOut

Function IcmpAliasOut

freebsd/netinet/libalias/alias.c:622–656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

620}
621
622static int
623IcmpAliasOut(struct libalias *la, struct ip *pip, int create)
624{
625 int iresult;
626 struct icmp *ic;
627
628 LIBALIAS_LOCK_ASSERT(la);
629 (void)create;
630
631/* Return if proxy-only mode is enabled */
632 if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY)
633 return (PKT_ALIAS_OK);
634
635 ic = (struct icmp *)ip_next(pip);
636
637 iresult = PKT_ALIAS_IGNORED;
638 switch (ic->icmp_type) {
639 case ICMP_ECHO:
640 case ICMP_TSTAMP:
641 if (ic->icmp_code == 0) {
642 iresult = IcmpAliasOut1(la, pip, create);
643 }
644 break;
645 case ICMP_UNREACH:
646 case ICMP_SOURCEQUENCH:
647 case ICMP_TIMXCEED:
648 case ICMP_PARAMPROB:
649 iresult = IcmpAliasOut2(la, pip);
650 break;
651 case ICMP_ECHOREPLY:
652 case ICMP_TSTAMPREPLY:
653 iresult = IcmpAliasOut1(la, pip, create);
654 }
655 return (iresult);
656}
657
658static int
659ProtoAliasIn(struct libalias *la, struct in_addr ip_src,

Callers 1

LibAliasOutLockedFunction · 0.85

Calls 3

ip_nextFunction · 0.85
IcmpAliasOut1Function · 0.85
IcmpAliasOut2Function · 0.85

Tested by

no test coverage detected