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

Function ReLink

freebsd/netinet/libalias/alias_db.c:1049–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049static struct alias_link *
1050ReLink(struct alias_link *old_lnk,
1051 struct in_addr src_addr,
1052 struct in_addr dst_addr,
1053 struct in_addr alias_addr,
1054 u_short src_port,
1055 u_short dst_port,
1056 int alias_port_param, /* if less than zero, alias */
1057 int link_type)
1058{ /* port will be automatically *//* chosen.
1059 * If greater than */
1060 struct alias_link *new_lnk; /* zero, equal to alias port */
1061 struct libalias *la = old_lnk->la;
1062
1063 LIBALIAS_LOCK_ASSERT(la);
1064 new_lnk = AddLink(la, src_addr, dst_addr, alias_addr,
1065 src_port, dst_port, alias_port_param,
1066 link_type);
1067#ifndef NO_FW_PUNCH
1068 if (new_lnk != NULL &&
1069 old_lnk->link_type == LINK_TCP &&
1070 old_lnk->data.tcp->fwhole > 0) {
1071 PunchFWHole(new_lnk);
1072 }
1073#endif
1074 DeleteLink(old_lnk);
1075 return (new_lnk);
1076}
1077
1078static struct alias_link *
1079_FindLinkOut(struct libalias *la, struct in_addr src_addr,

Callers 3

_FindLinkOutFunction · 0.85
_FindLinkInFunction · 0.85
SetDestCallIdFunction · 0.85

Calls 3

AddLinkFunction · 0.85
PunchFWHoleFunction · 0.85
DeleteLinkFunction · 0.85

Tested by

no test coverage detected