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

Function FindUdpTcpIn

freebsd/netinet/libalias/alias_db.c:1463–1500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1461}
1462
1463struct alias_link *
1464FindUdpTcpIn(struct libalias *la, struct in_addr dst_addr,
1465 struct in_addr alias_addr,
1466 u_short dst_port,
1467 u_short alias_port,
1468 u_char proto,
1469 int create)
1470{
1471 int link_type;
1472 struct alias_link *lnk;
1473
1474 LIBALIAS_LOCK_ASSERT(la);
1475 switch (proto) {
1476 case IPPROTO_UDP:
1477 link_type = LINK_UDP;
1478 break;
1479 case IPPROTO_TCP:
1480 link_type = LINK_TCP;
1481 break;
1482 default:
1483 return (NULL);
1484 break;
1485 }
1486
1487 lnk = FindLinkIn(la, dst_addr, alias_addr,
1488 dst_port, alias_port,
1489 link_type, create);
1490
1491 if (lnk == NULL && create && !(la->packetAliasMode & PKT_ALIAS_DENY_INCOMING)) {
1492 struct in_addr target_addr;
1493
1494 target_addr = FindOriginalAddress(la, alias_addr);
1495 lnk = AddLink(la, target_addr, dst_addr, alias_addr,
1496 alias_port, dst_port, alias_port,
1497 link_type);
1498 }
1499 return (lnk);
1500}
1501
1502struct alias_link *
1503FindUdpTcpOut(struct libalias *la, struct in_addr src_addr,

Callers 4

IcmpAliasIn2Function · 0.85
UdpAliasInFunction · 0.85
TcpAliasInFunction · 0.85
LibAliasUnaliasOutFunction · 0.85

Calls 3

FindLinkInFunction · 0.85
FindOriginalAddressFunction · 0.85
AddLinkFunction · 0.85

Tested by

no test coverage detected