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

Function AddSeq

freebsd/netinet/libalias/alias_db.c:1998–2029  ·  view source on GitHub ↗

XXX ip free

Source from the content-addressed store, hash-verified

1996
1997// XXX ip free
1998void
1999AddSeq(struct alias_link *lnk, int delta, u_int ip_hl, u_short ip_len,
2000 u_long th_seq, u_int th_off)
2001{
2002/*
2003When a TCP packet has been altered in length, save this
2004information in a circular list. If enough packets have
2005been altered, then this list will begin to overwrite itself.
2006*/
2007
2008 struct ack_data_record x;
2009 int hlen, tlen, dlen;
2010 int i;
2011
2012 hlen = (ip_hl + th_off) << 2;
2013 tlen = ntohs(ip_len);
2014 dlen = tlen - hlen;
2015
2016 x.ack_old = htonl(ntohl(th_seq) + dlen);
2017 x.ack_new = htonl(ntohl(th_seq) + dlen + delta);
2018 x.delta = delta;
2019 x.active = 1;
2020
2021 i = lnk->data.tcp->state.index;
2022 lnk->data.tcp->ack[i] = x;
2023
2024 i++;
2025 if (i == N_LINK_TCP_DATA)
2026 lnk->data.tcp->state.index = 0;
2027 else
2028 lnk->data.tcp->state.index = i;
2029}
2030
2031void
2032SetExpire(struct alias_link *lnk, int expire)

Callers 4

NewFtpMessageFunction · 0.85
AliasHandleIrcOutFunction · 0.85
alias_rtsp_outFunction · 0.85
ProxyEncodeTcpStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected