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

Function GetDeltaAckIn

freebsd/netinet/libalias/alias_db.c:1920–1956  ·  view source on GitHub ↗

XXX ip free

Source from the content-addressed store, hash-verified

1918
1919// XXX ip free
1920int
1921GetDeltaAckIn(u_long ack, struct alias_link *lnk)
1922{
1923/*
1924Find out how much the ACK number has been altered for an incoming
1925TCP packet. To do this, a circular list of ACK numbers where the TCP
1926packet size was altered is searched.
1927*/
1928
1929 int i;
1930 int delta, ack_diff_min;
1931
1932 delta = 0;
1933 ack_diff_min = -1;
1934 for (i = 0; i < N_LINK_TCP_DATA; i++) {
1935 struct ack_data_record x;
1936
1937 x = lnk->data.tcp->ack[i];
1938 if (x.active == 1) {
1939 int ack_diff;
1940
1941 ack_diff = SeqDiff(x.ack_new, ack);
1942 if (ack_diff >= 0) {
1943 if (ack_diff_min >= 0) {
1944 if (ack_diff < ack_diff_min) {
1945 delta = x.delta;
1946 ack_diff_min = ack_diff;
1947 }
1948 } else {
1949 delta = x.delta;
1950 ack_diff_min = ack_diff;
1951 }
1952 }
1953 }
1954 }
1955 return (delta);
1956}
1957
1958// XXX ip free
1959int

Callers 1

TcpAliasInFunction · 0.85

Calls 1

SeqDiffFunction · 0.85

Tested by

no test coverage detected