TCP/IP的代码,哪位高手能帮小弟我看一眼 大致给小弟我讲一下 多谢了

TCP/IP的代码,谁能帮我看一眼 大致给我讲一下 谢谢了
static inline void ipoque_connection_tracking(struct ipoque_detection_module_struct
  *ipoque_struct)
{
/* const for gcc code optimisation and cleaner code */
struct ipoque_packet_struct *packet = &ipoque_struct->packet;
const struct iphdr *iph = packet->iph;
#ifdef IPOQUE_DETECTION_SUPPORT_IPV6
const struct ipq_ipv6hdr *iphv6 = packet->iphv6;
#endif
const struct tcphdr *tcph = packet->tcp;
//const struct udphdr   *udph=ipoque_struct->packet.udp;
struct ipoque_flow_struct *flow = ipoque_struct->flow;

//struct ipoque_unique_flow_struct      unique_flow;
//uint8_t                               new_connection;

u8 proxy_enabled = 0;

packet->tcp_retransmission = 0;

packet->packet_direction = 0;


if (iph != NULL && iph->saddr < iph->daddr)
packet->packet_direction = 1;

#ifdef IPOQUE_DETECTION_SUPPORT_IPV6
if (iphv6 != NULL && IPOQUE_COMPARE_IPV6_ADDRESS_STRUCTS(&iphv6->saddr, &iphv6->daddr) != 0)
packet->packet_direction = 1;
#endif

packet->packet_lines_parsed_complete = 0;
packet->packet_unix_lines_parsed_complete = 0;
if (flow == NULL)
return;

if (flow->init_finished == 0) {
flow->init_finished = 1;
flow->setup_packet_direction = packet->packet_direction;
}

if (tcph != NULL) {
/* reset retried bytes here before setting it */
packet->num_retried_bytes = 0;

if (tcph->syn != 0 && tcph->ack == 0 && flow->l4.tcp.seen_syn == 0 && flow->l4.tcp.seen_syn_ack == 0
&& flow->l4.tcp.seen_ack == 0) {
flow->l4.tcp.seen_syn = 1;
}
if (tcph->syn != 0 && tcph->ack != 0 && flow->l4.tcp.seen_syn == 1 && flow->l4.tcp.seen_syn_ack == 0
&& flow->l4.tcp.seen_ack == 0) {
flow->l4.tcp.seen_syn_ack = 1;
}
if (tcph->syn == 0 && tcph->ack == 1 && flow->l4.tcp.seen_syn == 1 && flow->l4.tcp.seen_syn_ack == 1
&& flow->l4.tcp.seen_ack == 0) {
flow->l4.tcp.seen_ack = 1;
}
if ((flow->next_tcp_seq_nr[0] == 0 && flow->next_tcp_seq_nr[1] == 0)
|| (proxy_enabled && (flow->next_tcp_seq_nr[0] == 0 || flow->next_tcp_seq_nr[1] == 0))) {
/* initalize tcp sequence counters */
/* the ack flag needs to be set to get valid sequence numbers from the other
 * direction. Usually it will catch the second packet syn+ack but it works
 * also for asymmetric traffic where it will use the first data packet
 *
 * if the syn flag is set add one to the sequence number,
 * otherwise use the payload length.
 */
if (tcph->ack != 0) {
flow->next_tcp_seq_nr[ipoque_struct->packet.packet_direction] =
ntohl(tcph->seq) + (tcph->syn ? 1 : packet->payload_packet_len);
if (!proxy_enabled) {
flow->next_tcp_seq_nr[1 - ipoque_struct->packet.packet_direction] = ntohl(tcph->ack_seq);
}
}
} else if (packet->payload_packet_len > 0) {
/* check tcp sequence counters */
if (((u32)
 (ntohl(tcph->seq) -
  flow->next_tcp_seq_nr[packet->packet_direction])) >
ipoque_struct->tcp_max_retransmission_window_size) {

packet->tcp_retransmission = 1;


/*CHECK IF PARTIAL RETRY IS HAPPENENING */
if ((flow->next_tcp_seq_nr[packet->packet_direction] - ntohl(tcph->seq) < packet->payload_packet_len)) {
/* num_retried_bytes actual_payload_len hold info about the partial retry
   analyzer which require this info can make use of this info
   Other analyzer can use packet->payload_packet_len */
packet->num_retried_bytes = flow->next_tcp_seq_nr[packet->packet_direction] - ntohl(tcph->seq);