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

Function FindUdpTcpOut

freebsd/netinet/libalias/alias_db.c:1502–1537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1500}
1501
1502struct alias_link *
1503FindUdpTcpOut(struct libalias *la, struct in_addr src_addr,
1504 struct in_addr dst_addr,
1505 u_short src_port,
1506 u_short dst_port,
1507 u_char proto,
1508 int create)
1509{
1510 int link_type;
1511 struct alias_link *lnk;
1512
1513 LIBALIAS_LOCK_ASSERT(la);
1514 switch (proto) {
1515 case IPPROTO_UDP:
1516 link_type = LINK_UDP;
1517 break;
1518 case IPPROTO_TCP:
1519 link_type = LINK_TCP;
1520 break;
1521 default:
1522 return (NULL);
1523 break;
1524 }
1525
1526 lnk = FindLinkOut(la, src_addr, dst_addr, src_port, dst_port, link_type, create);
1527
1528 if (lnk == NULL && create) {
1529 struct in_addr alias_addr;
1530
1531 alias_addr = FindAliasAddress(la, src_addr);
1532 lnk = AddLink(la, src_addr, dst_addr, alias_addr,
1533 src_port, dst_port, GET_ALIAS_PORT,
1534 link_type);
1535 }
1536 return (lnk);
1537}
1538
1539struct alias_link *
1540AddPptp(struct libalias *la, struct in_addr src_addr,

Callers 6

AliasHandleIrcOutFunction · 0.85
alias_pna_outFunction · 0.85
IcmpAliasOut2Function · 0.85
UdpAliasOutFunction · 0.85
TcpAliasOutFunction · 0.85

Calls 3

FindLinkOutFunction · 0.85
FindAliasAddressFunction · 0.85
AddLinkFunction · 0.85

Tested by

no test coverage detected