Mechanical whitespace cleanup.
This commit is contained in:
parent
1af1ea79a8
commit
f311ebb4ec
@ -47,56 +47,56 @@ __FBSDID("$FreeBSD$");
|
|||||||
Version 1.0 August, 1996 (cjm)
|
Version 1.0 August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.1 August 20, 1996 (cjm)
|
Version 1.1 August 20, 1996 (cjm)
|
||||||
PPP host accepts incoming connections for ports 0 to 1023.
|
PPP host accepts incoming connections for ports 0 to 1023.
|
||||||
(Gary Roberts pointed out the need to handle incoming
|
(Gary Roberts pointed out the need to handle incoming
|
||||||
connections.)
|
connections.)
|
||||||
|
|
||||||
Version 1.2 September 7, 1996 (cjm)
|
Version 1.2 September 7, 1996 (cjm)
|
||||||
Fragment handling error in alias_db.c corrected.
|
Fragment handling error in alias_db.c corrected.
|
||||||
(Tom Torrance helped fix this problem.)
|
(Tom Torrance helped fix this problem.)
|
||||||
|
|
||||||
Version 1.4 September 16, 1996 (cjm)
|
Version 1.4 September 16, 1996 (cjm)
|
||||||
- A more generalized method for handling incoming
|
- A more generalized method for handling incoming
|
||||||
connections, without the 0-1023 restriction, is
|
connections, without the 0-1023 restriction, is
|
||||||
implemented in alias_db.c
|
implemented in alias_db.c
|
||||||
- Improved ICMP support in alias.c. Traceroute
|
- Improved ICMP support in alias.c. Traceroute
|
||||||
packet streams can now be correctly aliased.
|
packet streams can now be correctly aliased.
|
||||||
- TCP connection closing logic simplified in
|
- TCP connection closing logic simplified in
|
||||||
alias.c and now allows for additional 1 minute
|
alias.c and now allows for additional 1 minute
|
||||||
"grace period" after FIN or RST is observed.
|
"grace period" after FIN or RST is observed.
|
||||||
|
|
||||||
Version 1.5 September 17, 1996 (cjm)
|
Version 1.5 September 17, 1996 (cjm)
|
||||||
Corrected error in handling incoming UDP packets with 0 checksum.
|
Corrected error in handling incoming UDP packets with 0 checksum.
|
||||||
(Tom Torrance helped fix this problem.)
|
(Tom Torrance helped fix this problem.)
|
||||||
|
|
||||||
Version 1.6 September 18, 1996 (cjm)
|
Version 1.6 September 18, 1996 (cjm)
|
||||||
Simplified ICMP aliasing scheme. Should now support
|
Simplified ICMP aliasing scheme. Should now support
|
||||||
traceroute from Win95 as well as FreeBSD.
|
traceroute from Win95 as well as FreeBSD.
|
||||||
|
|
||||||
Version 1.7 January 9, 1997 (cjm)
|
Version 1.7 January 9, 1997 (cjm)
|
||||||
- Out-of-order fragment handling.
|
- Out-of-order fragment handling.
|
||||||
- IP checksum error fixed for ftp transfers
|
- IP checksum error fixed for ftp transfers
|
||||||
from aliasing host.
|
from aliasing host.
|
||||||
- Integer return codes added to all
|
- Integer return codes added to all
|
||||||
aliasing/de-aliasing functions.
|
aliasing/de-aliasing functions.
|
||||||
- Some obsolete comments cleaned up.
|
- Some obsolete comments cleaned up.
|
||||||
- Differential checksum computations for
|
- Differential checksum computations for
|
||||||
IP header (TCP, UDP and ICMP were already
|
IP header (TCP, UDP and ICMP were already
|
||||||
differential).
|
differential).
|
||||||
|
|
||||||
Version 2.1 May 1997 (cjm)
|
Version 2.1 May 1997 (cjm)
|
||||||
- Added support for outgoing ICMP error
|
- Added support for outgoing ICMP error
|
||||||
messages.
|
messages.
|
||||||
- Added two functions PacketAliasIn2()
|
- Added two functions PacketAliasIn2()
|
||||||
and PacketAliasOut2() for dynamic address
|
and PacketAliasOut2() for dynamic address
|
||||||
control (e.g. round-robin allocation of
|
control (e.g. round-robin allocation of
|
||||||
incoming packets).
|
incoming packets).
|
||||||
|
|
||||||
Version 2.2 July 1997 (cjm)
|
Version 2.2 July 1997 (cjm)
|
||||||
- Rationalized API function names to begin
|
- Rationalized API function names to begin
|
||||||
with "PacketAlias..."
|
with "PacketAlias..."
|
||||||
- Eliminated PacketAliasIn2() and
|
- Eliminated PacketAliasIn2() and
|
||||||
PacketAliasOut2() as poorly conceived.
|
PacketAliasOut2() as poorly conceived.
|
||||||
|
|
||||||
Version 2.3 Dec 1998 (dillon)
|
Version 2.3 Dec 1998 (dillon)
|
||||||
- Major bounds checking additions, see FreeBSD/CVS
|
- Major bounds checking additions, see FreeBSD/CVS
|
||||||
@ -1079,12 +1079,12 @@ FragmentOut(struct libalias *la, struct ip *pip)
|
|||||||
|
|
||||||
/* Outside World Access
|
/* Outside World Access
|
||||||
|
|
||||||
PacketAliasSaveFragment()
|
PacketAliasSaveFragment()
|
||||||
PacketAliasGetFragment()
|
PacketAliasGetFragment()
|
||||||
PacketAliasFragmentIn()
|
PacketAliasFragmentIn()
|
||||||
PacketAliasIn()
|
PacketAliasIn()
|
||||||
PacketAliasOut()
|
PacketAliasOut()
|
||||||
PacketUnaliasOut()
|
PacketUnaliasOut()
|
||||||
|
|
||||||
(prototypes in alias.h)
|
(prototypes in alias.h)
|
||||||
*/
|
*/
|
||||||
|
@ -50,92 +50,92 @@ __FBSDID("$FreeBSD$");
|
|||||||
Initial version: August, 1996 (cjm)
|
Initial version: August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.4: September 16, 1996 (cjm)
|
Version 1.4: September 16, 1996 (cjm)
|
||||||
Facility for handling incoming links added.
|
Facility for handling incoming links added.
|
||||||
|
|
||||||
Version 1.6: September 18, 1996 (cjm)
|
Version 1.6: September 18, 1996 (cjm)
|
||||||
ICMP data handling simplified.
|
ICMP data handling simplified.
|
||||||
|
|
||||||
Version 1.7: January 9, 1997 (cjm)
|
Version 1.7: January 9, 1997 (cjm)
|
||||||
Fragment handling simplified.
|
Fragment handling simplified.
|
||||||
Saves pointers for unresolved fragments.
|
Saves pointers for unresolved fragments.
|
||||||
Permits links for unspecified remote ports
|
Permits links for unspecified remote ports
|
||||||
or unspecified remote addresses.
|
or unspecified remote addresses.
|
||||||
Fixed bug which did not properly zero port
|
Fixed bug which did not properly zero port
|
||||||
table entries after a link was deleted.
|
table entries after a link was deleted.
|
||||||
Cleaned up some obsolete comments.
|
Cleaned up some obsolete comments.
|
||||||
|
|
||||||
Version 1.8: January 14, 1997 (cjm)
|
Version 1.8: January 14, 1997 (cjm)
|
||||||
Fixed data type error in StartPoint().
|
Fixed data type error in StartPoint().
|
||||||
(This error did not exist prior to v1.7
|
(This error did not exist prior to v1.7
|
||||||
and was discovered and fixed by Ari Suutari)
|
and was discovered and fixed by Ari Suutari)
|
||||||
|
|
||||||
Version 1.9: February 1, 1997
|
Version 1.9: February 1, 1997
|
||||||
Optionally, connections initiated from packet aliasing host
|
Optionally, connections initiated from packet aliasing host
|
||||||
machine will will not have their port number aliased unless it
|
machine will will not have their port number aliased unless it
|
||||||
conflicts with an aliasing port already being used. (cjm)
|
conflicts with an aliasing port already being used. (cjm)
|
||||||
|
|
||||||
All options earlier being #ifdef'ed are now available through
|
All options earlier being #ifdef'ed are now available through
|
||||||
a new interface, SetPacketAliasMode(). This allows run time
|
a new interface, SetPacketAliasMode(). This allows run time
|
||||||
control (which is now available in PPP+pktAlias through the
|
control (which is now available in PPP+pktAlias through the
|
||||||
'alias' keyword). (ee)
|
'alias' keyword). (ee)
|
||||||
|
|
||||||
Added ability to create an alias port without
|
Added ability to create an alias port without
|
||||||
either destination address or port specified.
|
either destination address or port specified.
|
||||||
port type = ALIAS_PORT_UNKNOWN_DEST_ALL (ee)
|
port type = ALIAS_PORT_UNKNOWN_DEST_ALL (ee)
|
||||||
|
|
||||||
Removed K&R style function headers
|
Removed K&R style function headers
|
||||||
and general cleanup. (ee)
|
and general cleanup. (ee)
|
||||||
|
|
||||||
Added packetAliasMode to replace compiler #defines's (ee)
|
Added packetAliasMode to replace compiler #defines's (ee)
|
||||||
|
|
||||||
Allocates sockets for partially specified
|
Allocates sockets for partially specified
|
||||||
ports if ALIAS_USE_SOCKETS defined. (cjm)
|
ports if ALIAS_USE_SOCKETS defined. (cjm)
|
||||||
|
|
||||||
Version 2.0: March, 1997
|
Version 2.0: March, 1997
|
||||||
SetAliasAddress() will now clean up alias links
|
SetAliasAddress() will now clean up alias links
|
||||||
if the aliasing address is changed. (cjm)
|
if the aliasing address is changed. (cjm)
|
||||||
|
|
||||||
PacketAliasPermanentLink() function added to support permanent
|
PacketAliasPermanentLink() function added to support permanent
|
||||||
links. (J. Fortes suggested the need for this.)
|
links. (J. Fortes suggested the need for this.)
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
(192.168.0.1, port 23) <-> alias port 6002, unknown dest addr/port
|
(192.168.0.1, port 23) <-> alias port 6002, unknown dest addr/port
|
||||||
|
|
||||||
(192.168.0.2, port 21) <-> alias port 3604, known dest addr
|
(192.168.0.2, port 21) <-> alias port 3604, known dest addr
|
||||||
unknown dest port
|
unknown dest port
|
||||||
|
|
||||||
These permanent links allow for incoming connections to
|
These permanent links allow for incoming connections to
|
||||||
machines on the local network. They can be given with a
|
machines on the local network. They can be given with a
|
||||||
user-chosen amount of specificity, with increasing specificity
|
user-chosen amount of specificity, with increasing specificity
|
||||||
meaning more security. (cjm)
|
meaning more security. (cjm)
|
||||||
|
|
||||||
Quite a bit of rework to the basic engine. The portTable[]
|
Quite a bit of rework to the basic engine. The portTable[]
|
||||||
array, which kept track of which ports were in use was replaced
|
array, which kept track of which ports were in use was replaced
|
||||||
by a table/linked list structure. (cjm)
|
by a table/linked list structure. (cjm)
|
||||||
|
|
||||||
SetExpire() function added. (cjm)
|
SetExpire() function added. (cjm)
|
||||||
|
|
||||||
DeleteLink() no longer frees memory association with a pointer
|
DeleteLink() no longer frees memory association with a pointer
|
||||||
to a fragment (this bug was first recognized by E. Eklund in
|
to a fragment (this bug was first recognized by E. Eklund in
|
||||||
v1.9).
|
v1.9).
|
||||||
|
|
||||||
Version 2.1: May, 1997 (cjm)
|
Version 2.1: May, 1997 (cjm)
|
||||||
Packet aliasing engine reworked so that it can handle
|
Packet aliasing engine reworked so that it can handle
|
||||||
multiple external addresses rather than just a single
|
multiple external addresses rather than just a single
|
||||||
host address.
|
host address.
|
||||||
|
|
||||||
PacketAliasRedirectPort() and PacketAliasRedirectAddr()
|
PacketAliasRedirectPort() and PacketAliasRedirectAddr()
|
||||||
added to the API. The first function is a more generalized
|
added to the API. The first function is a more generalized
|
||||||
version of PacketAliasPermanentLink(). The second function
|
version of PacketAliasPermanentLink(). The second function
|
||||||
implements static network address translation.
|
implements static network address translation.
|
||||||
|
|
||||||
Version 3.2: July, 2000 (salander and satoh)
|
Version 3.2: July, 2000 (salander and satoh)
|
||||||
Added FindNewPortGroup to get contiguous range of port values.
|
Added FindNewPortGroup to get contiguous range of port values.
|
||||||
|
|
||||||
Added QueryUdpTcpIn and QueryUdpTcpOut to look for an aliasing
|
Added QueryUdpTcpIn and QueryUdpTcpOut to look for an aliasing
|
||||||
link but not actually add one.
|
link but not actually add one.
|
||||||
|
|
||||||
Added FindRtspOut, which is closely derived from FindUdpTcpOut,
|
Added FindRtspOut, which is closely derived from FindUdpTcpOut,
|
||||||
except that the alias port (from FindNewPortGroup) is provided
|
except that the alias port (from FindNewPortGroup) is provided
|
||||||
as input.
|
as input.
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Constants (note: constants are also defined
|
Constants (note: constants are also defined
|
||||||
near relevant functions or structs)
|
near relevant functions or structs)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Parameters used for cleanup of expired links */
|
/* Parameters used for cleanup of expired links */
|
||||||
@ -331,9 +331,9 @@ struct alias_link { /* Main data structure */
|
|||||||
|
|
||||||
Lookup table starting points:
|
Lookup table starting points:
|
||||||
StartPointIn() -- link table initial search point for
|
StartPointIn() -- link table initial search point for
|
||||||
incoming packets
|
incoming packets
|
||||||
StartPointOut() -- link table initial search point for
|
StartPointOut() -- link table initial search point for
|
||||||
outgoing packets
|
outgoing packets
|
||||||
|
|
||||||
Miscellaneous:
|
Miscellaneous:
|
||||||
SeqDiff() -- difference between two TCP sequences
|
SeqDiff() -- difference between two TCP sequences
|
||||||
|
@ -50,17 +50,17 @@ __FBSDID("$FreeBSD$");
|
|||||||
Initial version: August, 1996 (cjm)
|
Initial version: August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.6
|
Version 1.6
|
||||||
Brian Somers and Martin Renters identified an IP checksum
|
Brian Somers and Martin Renters identified an IP checksum
|
||||||
error for modified IP packets.
|
error for modified IP packets.
|
||||||
|
|
||||||
Version 1.7: January 9, 1996 (cjm)
|
Version 1.7: January 9, 1996 (cjm)
|
||||||
Differential checksum computation for change
|
Differential checksum computation for change
|
||||||
in IP packet length.
|
in IP packet length.
|
||||||
|
|
||||||
Version 2.1: May, 1997 (cjm)
|
Version 2.1: May, 1997 (cjm)
|
||||||
Very minor changes to conform with
|
Very minor changes to conform with
|
||||||
local/global/function naming conventions
|
local/global/function naming conventions
|
||||||
within the packet aliasing module.
|
within the packet aliasing module.
|
||||||
|
|
||||||
Version 3.1: May, 2000 (eds)
|
Version 3.1: May, 2000 (eds)
|
||||||
Add support for passive mode, alias the 227 replies.
|
Add support for passive mode, alias the 227 replies.
|
||||||
@ -106,7 +106,7 @@ AliasHandleFtpOut(
|
|||||||
struct ip *pip, /* IP packet to examine/patch */
|
struct ip *pip, /* IP packet to examine/patch */
|
||||||
struct alias_link *link, /* The link to go through (aliased port) */
|
struct alias_link *link, /* The link to go through (aliased port) */
|
||||||
int maxpacketsize /* The maximum size this packet can grow to
|
int maxpacketsize /* The maximum size this packet can grow to
|
||||||
(including headers) */ )
|
(including headers) */ )
|
||||||
{
|
{
|
||||||
int hlen, tlen, dlen, pflags;
|
int hlen, tlen, dlen, pflags;
|
||||||
char *sptr;
|
char *sptr;
|
||||||
|
@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
Initial version: Eivind Eklund <perhaps@yes.no> (ee) 97-01-29
|
Initial version: Eivind Eklund <perhaps@yes.no> (ee) 97-01-29
|
||||||
|
|
||||||
Version 2.1: May, 1997 (cjm)
|
Version 2.1: May, 1997 (cjm)
|
||||||
Very minor changes to conform with
|
Very minor changes to conform with
|
||||||
local/global/function naming conventions
|
local/global/function naming conventions
|
||||||
withing the packet alising module.
|
withing the packet alising module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Includes */
|
/* Includes */
|
||||||
|
@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
There is one public API function:
|
There is one public API function:
|
||||||
|
|
||||||
PacketAliasProxyRule() -- Adds and deletes proxy
|
PacketAliasProxyRule() -- Adds and deletes proxy
|
||||||
rules.
|
rules.
|
||||||
|
|
||||||
Rules are stored in a linear linked list, so lookup efficiency
|
Rules are stored in a linear linked list, so lookup efficiency
|
||||||
won't be too good for large lists.
|
won't be too good for large lists.
|
||||||
@ -118,19 +118,19 @@ struct proxy_entry {
|
|||||||
/* Local (static) functions:
|
/* Local (static) functions:
|
||||||
|
|
||||||
IpMask() -- Utility function for creating IP
|
IpMask() -- Utility function for creating IP
|
||||||
masks from integer (1-32) specification.
|
masks from integer (1-32) specification.
|
||||||
IpAddr() -- Utility function for converting string
|
IpAddr() -- Utility function for converting string
|
||||||
to IP address
|
to IP address
|
||||||
IpPort() -- Utility function for converting string
|
IpPort() -- Utility function for converting string
|
||||||
to port number
|
to port number
|
||||||
RuleAdd() -- Adds an element to the rule list.
|
RuleAdd() -- Adds an element to the rule list.
|
||||||
RuleDelete() -- Removes an element from the rule list.
|
RuleDelete() -- Removes an element from the rule list.
|
||||||
RuleNumberDelete() -- Removes all elements from the rule list
|
RuleNumberDelete() -- Removes all elements from the rule list
|
||||||
having a certain rule number.
|
having a certain rule number.
|
||||||
ProxyEncodeTcpStream() -- Adds [DEST x.x.x.x xxxx] to the beginning
|
ProxyEncodeTcpStream() -- Adds [DEST x.x.x.x xxxx] to the beginning
|
||||||
of a TCP stream.
|
of a TCP stream.
|
||||||
ProxyEncodeIpHeader() -- Adds an IP option indicating the true
|
ProxyEncodeIpHeader() -- Adds an IP option indicating the true
|
||||||
destination of a proxied IP packet
|
destination of a proxied IP packet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int IpMask(int, struct in_addr *);
|
static int IpMask(int, struct in_addr *);
|
||||||
@ -431,10 +431,10 @@ ProxyEncodeIpHeader(struct ip *pip,
|
|||||||
/* Functions by other packet alias source files
|
/* Functions by other packet alias source files
|
||||||
|
|
||||||
ProxyCheck() -- Checks whether an outgoing packet should
|
ProxyCheck() -- Checks whether an outgoing packet should
|
||||||
be proxied.
|
be proxied.
|
||||||
ProxyModify() -- Encodes the original destination address/port
|
ProxyModify() -- Encodes the original destination address/port
|
||||||
for a packet which is to be redirected to
|
for a packet which is to be redirected to
|
||||||
a proxy server.
|
a proxy server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
Initial Version: August, 1996 (cjm)
|
Initial Version: August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.7: January 9, 1997
|
Version 1.7: January 9, 1997
|
||||||
Added differential checksum update function.
|
Added differential checksum update function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -47,56 +47,56 @@ __FBSDID("$FreeBSD$");
|
|||||||
Version 1.0 August, 1996 (cjm)
|
Version 1.0 August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.1 August 20, 1996 (cjm)
|
Version 1.1 August 20, 1996 (cjm)
|
||||||
PPP host accepts incoming connections for ports 0 to 1023.
|
PPP host accepts incoming connections for ports 0 to 1023.
|
||||||
(Gary Roberts pointed out the need to handle incoming
|
(Gary Roberts pointed out the need to handle incoming
|
||||||
connections.)
|
connections.)
|
||||||
|
|
||||||
Version 1.2 September 7, 1996 (cjm)
|
Version 1.2 September 7, 1996 (cjm)
|
||||||
Fragment handling error in alias_db.c corrected.
|
Fragment handling error in alias_db.c corrected.
|
||||||
(Tom Torrance helped fix this problem.)
|
(Tom Torrance helped fix this problem.)
|
||||||
|
|
||||||
Version 1.4 September 16, 1996 (cjm)
|
Version 1.4 September 16, 1996 (cjm)
|
||||||
- A more generalized method for handling incoming
|
- A more generalized method for handling incoming
|
||||||
connections, without the 0-1023 restriction, is
|
connections, without the 0-1023 restriction, is
|
||||||
implemented in alias_db.c
|
implemented in alias_db.c
|
||||||
- Improved ICMP support in alias.c. Traceroute
|
- Improved ICMP support in alias.c. Traceroute
|
||||||
packet streams can now be correctly aliased.
|
packet streams can now be correctly aliased.
|
||||||
- TCP connection closing logic simplified in
|
- TCP connection closing logic simplified in
|
||||||
alias.c and now allows for additional 1 minute
|
alias.c and now allows for additional 1 minute
|
||||||
"grace period" after FIN or RST is observed.
|
"grace period" after FIN or RST is observed.
|
||||||
|
|
||||||
Version 1.5 September 17, 1996 (cjm)
|
Version 1.5 September 17, 1996 (cjm)
|
||||||
Corrected error in handling incoming UDP packets with 0 checksum.
|
Corrected error in handling incoming UDP packets with 0 checksum.
|
||||||
(Tom Torrance helped fix this problem.)
|
(Tom Torrance helped fix this problem.)
|
||||||
|
|
||||||
Version 1.6 September 18, 1996 (cjm)
|
Version 1.6 September 18, 1996 (cjm)
|
||||||
Simplified ICMP aliasing scheme. Should now support
|
Simplified ICMP aliasing scheme. Should now support
|
||||||
traceroute from Win95 as well as FreeBSD.
|
traceroute from Win95 as well as FreeBSD.
|
||||||
|
|
||||||
Version 1.7 January 9, 1997 (cjm)
|
Version 1.7 January 9, 1997 (cjm)
|
||||||
- Out-of-order fragment handling.
|
- Out-of-order fragment handling.
|
||||||
- IP checksum error fixed for ftp transfers
|
- IP checksum error fixed for ftp transfers
|
||||||
from aliasing host.
|
from aliasing host.
|
||||||
- Integer return codes added to all
|
- Integer return codes added to all
|
||||||
aliasing/de-aliasing functions.
|
aliasing/de-aliasing functions.
|
||||||
- Some obsolete comments cleaned up.
|
- Some obsolete comments cleaned up.
|
||||||
- Differential checksum computations for
|
- Differential checksum computations for
|
||||||
IP header (TCP, UDP and ICMP were already
|
IP header (TCP, UDP and ICMP were already
|
||||||
differential).
|
differential).
|
||||||
|
|
||||||
Version 2.1 May 1997 (cjm)
|
Version 2.1 May 1997 (cjm)
|
||||||
- Added support for outgoing ICMP error
|
- Added support for outgoing ICMP error
|
||||||
messages.
|
messages.
|
||||||
- Added two functions PacketAliasIn2()
|
- Added two functions PacketAliasIn2()
|
||||||
and PacketAliasOut2() for dynamic address
|
and PacketAliasOut2() for dynamic address
|
||||||
control (e.g. round-robin allocation of
|
control (e.g. round-robin allocation of
|
||||||
incoming packets).
|
incoming packets).
|
||||||
|
|
||||||
Version 2.2 July 1997 (cjm)
|
Version 2.2 July 1997 (cjm)
|
||||||
- Rationalized API function names to begin
|
- Rationalized API function names to begin
|
||||||
with "PacketAlias..."
|
with "PacketAlias..."
|
||||||
- Eliminated PacketAliasIn2() and
|
- Eliminated PacketAliasIn2() and
|
||||||
PacketAliasOut2() as poorly conceived.
|
PacketAliasOut2() as poorly conceived.
|
||||||
|
|
||||||
Version 2.3 Dec 1998 (dillon)
|
Version 2.3 Dec 1998 (dillon)
|
||||||
- Major bounds checking additions, see FreeBSD/CVS
|
- Major bounds checking additions, see FreeBSD/CVS
|
||||||
@ -1079,12 +1079,12 @@ FragmentOut(struct libalias *la, struct ip *pip)
|
|||||||
|
|
||||||
/* Outside World Access
|
/* Outside World Access
|
||||||
|
|
||||||
PacketAliasSaveFragment()
|
PacketAliasSaveFragment()
|
||||||
PacketAliasGetFragment()
|
PacketAliasGetFragment()
|
||||||
PacketAliasFragmentIn()
|
PacketAliasFragmentIn()
|
||||||
PacketAliasIn()
|
PacketAliasIn()
|
||||||
PacketAliasOut()
|
PacketAliasOut()
|
||||||
PacketUnaliasOut()
|
PacketUnaliasOut()
|
||||||
|
|
||||||
(prototypes in alias.h)
|
(prototypes in alias.h)
|
||||||
*/
|
*/
|
||||||
|
@ -50,92 +50,92 @@ __FBSDID("$FreeBSD$");
|
|||||||
Initial version: August, 1996 (cjm)
|
Initial version: August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.4: September 16, 1996 (cjm)
|
Version 1.4: September 16, 1996 (cjm)
|
||||||
Facility for handling incoming links added.
|
Facility for handling incoming links added.
|
||||||
|
|
||||||
Version 1.6: September 18, 1996 (cjm)
|
Version 1.6: September 18, 1996 (cjm)
|
||||||
ICMP data handling simplified.
|
ICMP data handling simplified.
|
||||||
|
|
||||||
Version 1.7: January 9, 1997 (cjm)
|
Version 1.7: January 9, 1997 (cjm)
|
||||||
Fragment handling simplified.
|
Fragment handling simplified.
|
||||||
Saves pointers for unresolved fragments.
|
Saves pointers for unresolved fragments.
|
||||||
Permits links for unspecified remote ports
|
Permits links for unspecified remote ports
|
||||||
or unspecified remote addresses.
|
or unspecified remote addresses.
|
||||||
Fixed bug which did not properly zero port
|
Fixed bug which did not properly zero port
|
||||||
table entries after a link was deleted.
|
table entries after a link was deleted.
|
||||||
Cleaned up some obsolete comments.
|
Cleaned up some obsolete comments.
|
||||||
|
|
||||||
Version 1.8: January 14, 1997 (cjm)
|
Version 1.8: January 14, 1997 (cjm)
|
||||||
Fixed data type error in StartPoint().
|
Fixed data type error in StartPoint().
|
||||||
(This error did not exist prior to v1.7
|
(This error did not exist prior to v1.7
|
||||||
and was discovered and fixed by Ari Suutari)
|
and was discovered and fixed by Ari Suutari)
|
||||||
|
|
||||||
Version 1.9: February 1, 1997
|
Version 1.9: February 1, 1997
|
||||||
Optionally, connections initiated from packet aliasing host
|
Optionally, connections initiated from packet aliasing host
|
||||||
machine will will not have their port number aliased unless it
|
machine will will not have their port number aliased unless it
|
||||||
conflicts with an aliasing port already being used. (cjm)
|
conflicts with an aliasing port already being used. (cjm)
|
||||||
|
|
||||||
All options earlier being #ifdef'ed are now available through
|
All options earlier being #ifdef'ed are now available through
|
||||||
a new interface, SetPacketAliasMode(). This allows run time
|
a new interface, SetPacketAliasMode(). This allows run time
|
||||||
control (which is now available in PPP+pktAlias through the
|
control (which is now available in PPP+pktAlias through the
|
||||||
'alias' keyword). (ee)
|
'alias' keyword). (ee)
|
||||||
|
|
||||||
Added ability to create an alias port without
|
Added ability to create an alias port without
|
||||||
either destination address or port specified.
|
either destination address or port specified.
|
||||||
port type = ALIAS_PORT_UNKNOWN_DEST_ALL (ee)
|
port type = ALIAS_PORT_UNKNOWN_DEST_ALL (ee)
|
||||||
|
|
||||||
Removed K&R style function headers
|
Removed K&R style function headers
|
||||||
and general cleanup. (ee)
|
and general cleanup. (ee)
|
||||||
|
|
||||||
Added packetAliasMode to replace compiler #defines's (ee)
|
Added packetAliasMode to replace compiler #defines's (ee)
|
||||||
|
|
||||||
Allocates sockets for partially specified
|
Allocates sockets for partially specified
|
||||||
ports if ALIAS_USE_SOCKETS defined. (cjm)
|
ports if ALIAS_USE_SOCKETS defined. (cjm)
|
||||||
|
|
||||||
Version 2.0: March, 1997
|
Version 2.0: March, 1997
|
||||||
SetAliasAddress() will now clean up alias links
|
SetAliasAddress() will now clean up alias links
|
||||||
if the aliasing address is changed. (cjm)
|
if the aliasing address is changed. (cjm)
|
||||||
|
|
||||||
PacketAliasPermanentLink() function added to support permanent
|
PacketAliasPermanentLink() function added to support permanent
|
||||||
links. (J. Fortes suggested the need for this.)
|
links. (J. Fortes suggested the need for this.)
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
(192.168.0.1, port 23) <-> alias port 6002, unknown dest addr/port
|
(192.168.0.1, port 23) <-> alias port 6002, unknown dest addr/port
|
||||||
|
|
||||||
(192.168.0.2, port 21) <-> alias port 3604, known dest addr
|
(192.168.0.2, port 21) <-> alias port 3604, known dest addr
|
||||||
unknown dest port
|
unknown dest port
|
||||||
|
|
||||||
These permanent links allow for incoming connections to
|
These permanent links allow for incoming connections to
|
||||||
machines on the local network. They can be given with a
|
machines on the local network. They can be given with a
|
||||||
user-chosen amount of specificity, with increasing specificity
|
user-chosen amount of specificity, with increasing specificity
|
||||||
meaning more security. (cjm)
|
meaning more security. (cjm)
|
||||||
|
|
||||||
Quite a bit of rework to the basic engine. The portTable[]
|
Quite a bit of rework to the basic engine. The portTable[]
|
||||||
array, which kept track of which ports were in use was replaced
|
array, which kept track of which ports were in use was replaced
|
||||||
by a table/linked list structure. (cjm)
|
by a table/linked list structure. (cjm)
|
||||||
|
|
||||||
SetExpire() function added. (cjm)
|
SetExpire() function added. (cjm)
|
||||||
|
|
||||||
DeleteLink() no longer frees memory association with a pointer
|
DeleteLink() no longer frees memory association with a pointer
|
||||||
to a fragment (this bug was first recognized by E. Eklund in
|
to a fragment (this bug was first recognized by E. Eklund in
|
||||||
v1.9).
|
v1.9).
|
||||||
|
|
||||||
Version 2.1: May, 1997 (cjm)
|
Version 2.1: May, 1997 (cjm)
|
||||||
Packet aliasing engine reworked so that it can handle
|
Packet aliasing engine reworked so that it can handle
|
||||||
multiple external addresses rather than just a single
|
multiple external addresses rather than just a single
|
||||||
host address.
|
host address.
|
||||||
|
|
||||||
PacketAliasRedirectPort() and PacketAliasRedirectAddr()
|
PacketAliasRedirectPort() and PacketAliasRedirectAddr()
|
||||||
added to the API. The first function is a more generalized
|
added to the API. The first function is a more generalized
|
||||||
version of PacketAliasPermanentLink(). The second function
|
version of PacketAliasPermanentLink(). The second function
|
||||||
implements static network address translation.
|
implements static network address translation.
|
||||||
|
|
||||||
Version 3.2: July, 2000 (salander and satoh)
|
Version 3.2: July, 2000 (salander and satoh)
|
||||||
Added FindNewPortGroup to get contiguous range of port values.
|
Added FindNewPortGroup to get contiguous range of port values.
|
||||||
|
|
||||||
Added QueryUdpTcpIn and QueryUdpTcpOut to look for an aliasing
|
Added QueryUdpTcpIn and QueryUdpTcpOut to look for an aliasing
|
||||||
link but not actually add one.
|
link but not actually add one.
|
||||||
|
|
||||||
Added FindRtspOut, which is closely derived from FindUdpTcpOut,
|
Added FindRtspOut, which is closely derived from FindUdpTcpOut,
|
||||||
except that the alias port (from FindNewPortGroup) is provided
|
except that the alias port (from FindNewPortGroup) is provided
|
||||||
as input.
|
as input.
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ static LIST_HEAD(, libalias) instancehead = LIST_HEAD_INITIALIZER(instancehead)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Constants (note: constants are also defined
|
Constants (note: constants are also defined
|
||||||
near relevant functions or structs)
|
near relevant functions or structs)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Parameters used for cleanup of expired links */
|
/* Parameters used for cleanup of expired links */
|
||||||
@ -331,9 +331,9 @@ struct alias_link { /* Main data structure */
|
|||||||
|
|
||||||
Lookup table starting points:
|
Lookup table starting points:
|
||||||
StartPointIn() -- link table initial search point for
|
StartPointIn() -- link table initial search point for
|
||||||
incoming packets
|
incoming packets
|
||||||
StartPointOut() -- link table initial search point for
|
StartPointOut() -- link table initial search point for
|
||||||
outgoing packets
|
outgoing packets
|
||||||
|
|
||||||
Miscellaneous:
|
Miscellaneous:
|
||||||
SeqDiff() -- difference between two TCP sequences
|
SeqDiff() -- difference between two TCP sequences
|
||||||
|
@ -50,17 +50,17 @@ __FBSDID("$FreeBSD$");
|
|||||||
Initial version: August, 1996 (cjm)
|
Initial version: August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.6
|
Version 1.6
|
||||||
Brian Somers and Martin Renters identified an IP checksum
|
Brian Somers and Martin Renters identified an IP checksum
|
||||||
error for modified IP packets.
|
error for modified IP packets.
|
||||||
|
|
||||||
Version 1.7: January 9, 1996 (cjm)
|
Version 1.7: January 9, 1996 (cjm)
|
||||||
Differential checksum computation for change
|
Differential checksum computation for change
|
||||||
in IP packet length.
|
in IP packet length.
|
||||||
|
|
||||||
Version 2.1: May, 1997 (cjm)
|
Version 2.1: May, 1997 (cjm)
|
||||||
Very minor changes to conform with
|
Very minor changes to conform with
|
||||||
local/global/function naming conventions
|
local/global/function naming conventions
|
||||||
within the packet aliasing module.
|
within the packet aliasing module.
|
||||||
|
|
||||||
Version 3.1: May, 2000 (eds)
|
Version 3.1: May, 2000 (eds)
|
||||||
Add support for passive mode, alias the 227 replies.
|
Add support for passive mode, alias the 227 replies.
|
||||||
@ -106,7 +106,7 @@ AliasHandleFtpOut(
|
|||||||
struct ip *pip, /* IP packet to examine/patch */
|
struct ip *pip, /* IP packet to examine/patch */
|
||||||
struct alias_link *link, /* The link to go through (aliased port) */
|
struct alias_link *link, /* The link to go through (aliased port) */
|
||||||
int maxpacketsize /* The maximum size this packet can grow to
|
int maxpacketsize /* The maximum size this packet can grow to
|
||||||
(including headers) */ )
|
(including headers) */ )
|
||||||
{
|
{
|
||||||
int hlen, tlen, dlen, pflags;
|
int hlen, tlen, dlen, pflags;
|
||||||
char *sptr;
|
char *sptr;
|
||||||
|
@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
Initial version: Eivind Eklund <perhaps@yes.no> (ee) 97-01-29
|
Initial version: Eivind Eklund <perhaps@yes.no> (ee) 97-01-29
|
||||||
|
|
||||||
Version 2.1: May, 1997 (cjm)
|
Version 2.1: May, 1997 (cjm)
|
||||||
Very minor changes to conform with
|
Very minor changes to conform with
|
||||||
local/global/function naming conventions
|
local/global/function naming conventions
|
||||||
withing the packet alising module.
|
withing the packet alising module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Includes */
|
/* Includes */
|
||||||
|
@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
There is one public API function:
|
There is one public API function:
|
||||||
|
|
||||||
PacketAliasProxyRule() -- Adds and deletes proxy
|
PacketAliasProxyRule() -- Adds and deletes proxy
|
||||||
rules.
|
rules.
|
||||||
|
|
||||||
Rules are stored in a linear linked list, so lookup efficiency
|
Rules are stored in a linear linked list, so lookup efficiency
|
||||||
won't be too good for large lists.
|
won't be too good for large lists.
|
||||||
@ -118,19 +118,19 @@ struct proxy_entry {
|
|||||||
/* Local (static) functions:
|
/* Local (static) functions:
|
||||||
|
|
||||||
IpMask() -- Utility function for creating IP
|
IpMask() -- Utility function for creating IP
|
||||||
masks from integer (1-32) specification.
|
masks from integer (1-32) specification.
|
||||||
IpAddr() -- Utility function for converting string
|
IpAddr() -- Utility function for converting string
|
||||||
to IP address
|
to IP address
|
||||||
IpPort() -- Utility function for converting string
|
IpPort() -- Utility function for converting string
|
||||||
to port number
|
to port number
|
||||||
RuleAdd() -- Adds an element to the rule list.
|
RuleAdd() -- Adds an element to the rule list.
|
||||||
RuleDelete() -- Removes an element from the rule list.
|
RuleDelete() -- Removes an element from the rule list.
|
||||||
RuleNumberDelete() -- Removes all elements from the rule list
|
RuleNumberDelete() -- Removes all elements from the rule list
|
||||||
having a certain rule number.
|
having a certain rule number.
|
||||||
ProxyEncodeTcpStream() -- Adds [DEST x.x.x.x xxxx] to the beginning
|
ProxyEncodeTcpStream() -- Adds [DEST x.x.x.x xxxx] to the beginning
|
||||||
of a TCP stream.
|
of a TCP stream.
|
||||||
ProxyEncodeIpHeader() -- Adds an IP option indicating the true
|
ProxyEncodeIpHeader() -- Adds an IP option indicating the true
|
||||||
destination of a proxied IP packet
|
destination of a proxied IP packet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int IpMask(int, struct in_addr *);
|
static int IpMask(int, struct in_addr *);
|
||||||
@ -431,10 +431,10 @@ ProxyEncodeIpHeader(struct ip *pip,
|
|||||||
/* Functions by other packet alias source files
|
/* Functions by other packet alias source files
|
||||||
|
|
||||||
ProxyCheck() -- Checks whether an outgoing packet should
|
ProxyCheck() -- Checks whether an outgoing packet should
|
||||||
be proxied.
|
be proxied.
|
||||||
ProxyModify() -- Encodes the original destination address/port
|
ProxyModify() -- Encodes the original destination address/port
|
||||||
for a packet which is to be redirected to
|
for a packet which is to be redirected to
|
||||||
a proxy server.
|
a proxy server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
Initial Version: August, 1996 (cjm)
|
Initial Version: August, 1996 (cjm)
|
||||||
|
|
||||||
Version 1.7: January 9, 1997
|
Version 1.7: January 9, 1997
|
||||||
Added differential checksum update function.
|
Added differential checksum update function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user