Deleted Added
full compact
alias.c (50597) alias.c (51107)
1/* -*- mode: c; tab-width: 8; c-basic-indent: 4; -*- */
2/*
3 Alias.c provides supervisory control for the functions of the
4 packet aliasing software. It consists of routines to monitor
5 TCP connection state, protocol-specific aliasing routines,
6 fragment handling and the following outside world functional
7 interfaces: SaveFragmentPtr, GetFragmentPtr, FragmentAliasIn,
8 PacketAliasIn and PacketAliasOut.

--- 64 unchanged lines hidden (view full) ---

73 - Eliminated PacketAliasIn2() and
74 PacketAliasOut2() as poorly conceived.
75
76 Version 2.3 Dec 1998 (dillon)
77 - Major bounds checking additions, see FreeBSD/CVS
78
79 See HISTORY file for additional revisions.
80
1/* -*- mode: c; tab-width: 8; c-basic-indent: 4; -*- */
2/*
3 Alias.c provides supervisory control for the functions of the
4 packet aliasing software. It consists of routines to monitor
5 TCP connection state, protocol-specific aliasing routines,
6 fragment handling and the following outside world functional
7 interfaces: SaveFragmentPtr, GetFragmentPtr, FragmentAliasIn,
8 PacketAliasIn and PacketAliasOut.

--- 64 unchanged lines hidden (view full) ---

73 - Eliminated PacketAliasIn2() and
74 PacketAliasOut2() as poorly conceived.
75
76 Version 2.3 Dec 1998 (dillon)
77 - Major bounds checking additions, see FreeBSD/CVS
78
79 See HISTORY file for additional revisions.
80
81 $FreeBSD: head/sys/netinet/libalias/alias.c 50597 1999-08-29 23:17:04Z billf $
81 $FreeBSD: head/sys/netinet/libalias/alias.c 51107 1999-09-09 13:42:51Z ru $
82*/
83
84#include <stdio.h>
85#include <unistd.h>
86
87#include <sys/param.h>
88#include <sys/types.h>
89

--- 47 unchanged lines hidden (view full) ---

137
138 tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2));
139
140 switch (GetStateIn(link))
141 {
142 case ALIAS_TCP_STATE_NOT_CONNECTED:
143 if (tc->th_flags & TH_SYN)
144 SetStateIn(link, ALIAS_TCP_STATE_CONNECTED);
82*/
83
84#include <stdio.h>
85#include <unistd.h>
86
87#include <sys/param.h>
88#include <sys/types.h>
89

--- 47 unchanged lines hidden (view full) ---

137
138 tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2));
139
140 switch (GetStateIn(link))
141 {
142 case ALIAS_TCP_STATE_NOT_CONNECTED:
143 if (tc->th_flags & TH_SYN)
144 SetStateIn(link, ALIAS_TCP_STATE_CONNECTED);
145 break;
145 /*FALLTHROUGH*/
146 case ALIAS_TCP_STATE_CONNECTED:
147 if (tc->th_flags & TH_FIN
148 || tc->th_flags & TH_RST)
149 SetStateIn(link, ALIAS_TCP_STATE_DISCONNECTED);
150 break;
151 }
152}
153

--- 4 unchanged lines hidden (view full) ---

158
159 tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2));
160
161 switch (GetStateOut(link))
162 {
163 case ALIAS_TCP_STATE_NOT_CONNECTED:
164 if (tc->th_flags & TH_SYN)
165 SetStateOut(link, ALIAS_TCP_STATE_CONNECTED);
146 case ALIAS_TCP_STATE_CONNECTED:
147 if (tc->th_flags & TH_FIN
148 || tc->th_flags & TH_RST)
149 SetStateIn(link, ALIAS_TCP_STATE_DISCONNECTED);
150 break;
151 }
152}
153

--- 4 unchanged lines hidden (view full) ---

158
159 tc = (struct tcphdr *) ((char *) pip + (pip->ip_hl << 2));
160
161 switch (GetStateOut(link))
162 {
163 case ALIAS_TCP_STATE_NOT_CONNECTED:
164 if (tc->th_flags & TH_SYN)
165 SetStateOut(link, ALIAS_TCP_STATE_CONNECTED);
166 break;
166 /*FALLTHROUGH*/
167 case ALIAS_TCP_STATE_CONNECTED:
168 if (tc->th_flags & TH_FIN
169 || tc->th_flags & TH_RST)
170 SetStateOut(link, ALIAS_TCP_STATE_DISCONNECTED);
171 break;
172 }
173}
174

--- 1159 unchanged lines hidden ---
167 case ALIAS_TCP_STATE_CONNECTED:
168 if (tc->th_flags & TH_FIN
169 || tc->th_flags & TH_RST)
170 SetStateOut(link, ALIAS_TCP_STATE_DISCONNECTED);
171 break;
172 }
173}
174

--- 1159 unchanged lines hidden ---