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

Function TcpMonitorOut

freebsd/netinet/libalias/alias.c:210–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210static void
211TcpMonitorOut(u_char th_flags, struct alias_link *lnk)
212{
213
214 switch (GetStateOut(lnk)) {
215 case ALIAS_TCP_STATE_NOT_CONNECTED:
216 if (th_flags & TH_RST)
217 SetStateOut(lnk, ALIAS_TCP_STATE_DISCONNECTED);
218 else if (th_flags & TH_SYN)
219 SetStateOut(lnk, ALIAS_TCP_STATE_CONNECTED);
220 break;
221 case ALIAS_TCP_STATE_CONNECTED:
222 if (th_flags & (TH_FIN | TH_RST))
223 SetStateOut(lnk, ALIAS_TCP_STATE_DISCONNECTED);
224 break;
225 }
226}
227
228/* Protocol Specific Packet Aliasing Routines
229

Callers 1

TcpAliasOutFunction · 0.85

Calls 2

GetStateOutFunction · 0.85
SetStateOutFunction · 0.85

Tested by

no test coverage detected