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

Function FindLinkOut

freebsd/netinet/libalias/alias_db.c:1127–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127static struct alias_link *
1128FindLinkOut(struct libalias *la, struct in_addr src_addr,
1129 struct in_addr dst_addr,
1130 u_short src_port,
1131 u_short dst_port,
1132 int link_type,
1133 int replace_partial_links)
1134{
1135 struct alias_link *lnk;
1136
1137 LIBALIAS_LOCK_ASSERT(la);
1138 lnk = _FindLinkOut(la, src_addr, dst_addr, src_port, dst_port,
1139 link_type, replace_partial_links);
1140
1141 if (lnk == NULL) {
1142 /*
1143 * The following allows permanent links to be specified as
1144 * using the default source address (i.e. device interface
1145 * address) without knowing in advance what that address
1146 * is.
1147 */
1148 if (la->aliasAddress.s_addr != INADDR_ANY &&
1149 src_addr.s_addr == la->aliasAddress.s_addr) {
1150 lnk = _FindLinkOut(la, la->nullAddress, dst_addr, src_port, dst_port,
1151 link_type, replace_partial_links);
1152 }
1153 }
1154 return (lnk);
1155}
1156
1157static struct alias_link *
1158_FindLinkIn(struct libalias *la, struct in_addr dst_addr,

Callers 5

FindIcmpOutFunction · 0.85
FindProtoOutFunction · 0.85
FindUdpTcpOutFunction · 0.85
FindRtspOutFunction · 0.85
FindAliasAddressFunction · 0.85

Calls 1

_FindLinkOutFunction · 0.85

Tested by

no test coverage detected