Deleted Added
full compact
alias.c (116315) alias.c (120372)
1/* -*- mode: c; tab-width: 8; c-basic-indent: 4; -*- */
2
3/*-
4 * Copyright (c) 2001 Charles Mott <cm@linktel.net>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/* -*- mode: c; tab-width: 8; c-basic-indent: 4; -*- */
2
3/*-
4 * Copyright (c) 2001 Charles Mott <cm@linktel.net>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias.c 116315 2003-06-13 21:54:01Z ru $");
30__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias.c 120372 2003-09-23 07:41:55Z marcus $");
31
32/*
33 Alias.c provides supervisory control for the functions of the
34 packet aliasing software. It consists of routines to monitor
35 TCP connection state, protocol-specific aliasing routines,
36 fragment handling and the following outside world functional
37 interfaces: SaveFragmentPtr, GetFragmentPtr, FragmentAliasIn,
38 PacketAliasIn and PacketAliasOut.

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

912 u_short proxy_port;
913 int accumulate;
914 u_short *sptr;
915
916/* Special processing for IP encoding protocols */
917 if (ntohs(tc->th_dport) == PPTP_CONTROL_PORT_NUMBER
918 || ntohs(tc->th_sport) == PPTP_CONTROL_PORT_NUMBER)
919 AliasHandlePptpIn(pip, link);
31
32/*
33 Alias.c provides supervisory control for the functions of the
34 packet aliasing software. It consists of routines to monitor
35 TCP connection state, protocol-specific aliasing routines,
36 fragment handling and the following outside world functional
37 interfaces: SaveFragmentPtr, GetFragmentPtr, FragmentAliasIn,
38 PacketAliasIn and PacketAliasOut.

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

912 u_short proxy_port;
913 int accumulate;
914 u_short *sptr;
915
916/* Special processing for IP encoding protocols */
917 if (ntohs(tc->th_dport) == PPTP_CONTROL_PORT_NUMBER
918 || ntohs(tc->th_sport) == PPTP_CONTROL_PORT_NUMBER)
919 AliasHandlePptpIn(pip, link);
920 else if (skinnyPort != 0 && (ntohs(tc->th_dport) == skinnyPort
921 || ntohs(tc->th_sport) == skinnyPort))
922 AliasHandleSkinny(pip, link);
920
921 alias_address = GetAliasAddress(link);
922 original_address = GetOriginalAddress(link);
923 proxy_address = GetProxyAddress(link);
924 alias_port = tc->th_dport;
925 tc->th_dport = GetOriginalPort(link);
926 proxy_port = GetProxyPort(link);
927

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

1093 else if (ntohs(tc->th_dport) == RTSP_CONTROL_PORT_NUMBER_1
1094 || ntohs(tc->th_sport) == RTSP_CONTROL_PORT_NUMBER_1
1095 || ntohs(tc->th_dport) == RTSP_CONTROL_PORT_NUMBER_2
1096 || ntohs(tc->th_sport) == RTSP_CONTROL_PORT_NUMBER_2)
1097 AliasHandleRtspOut(pip, link, maxpacketsize);
1098 else if (ntohs(tc->th_dport) == PPTP_CONTROL_PORT_NUMBER
1099 || ntohs(tc->th_sport) == PPTP_CONTROL_PORT_NUMBER)
1100 AliasHandlePptpOut(pip, link);
923
924 alias_address = GetAliasAddress(link);
925 original_address = GetOriginalAddress(link);
926 proxy_address = GetProxyAddress(link);
927 alias_port = tc->th_dport;
928 tc->th_dport = GetOriginalPort(link);
929 proxy_port = GetProxyPort(link);
930

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

1096 else if (ntohs(tc->th_dport) == RTSP_CONTROL_PORT_NUMBER_1
1097 || ntohs(tc->th_sport) == RTSP_CONTROL_PORT_NUMBER_1
1098 || ntohs(tc->th_dport) == RTSP_CONTROL_PORT_NUMBER_2
1099 || ntohs(tc->th_sport) == RTSP_CONTROL_PORT_NUMBER_2)
1100 AliasHandleRtspOut(pip, link, maxpacketsize);
1101 else if (ntohs(tc->th_dport) == PPTP_CONTROL_PORT_NUMBER
1102 || ntohs(tc->th_sport) == PPTP_CONTROL_PORT_NUMBER)
1103 AliasHandlePptpOut(pip, link);
1104 else if (skinnyPort != 0 && (ntohs(tc->th_sport) == skinnyPort
1105 || ntohs(tc->th_dport) == skinnyPort))
1106 AliasHandleSkinny(pip, link);
1101
1102/* Adjust TCP checksum since source port is being aliased */
1103/* and source address is being altered */
1104 accumulate = tc->th_sport;
1105 tc->th_sport = alias_port;
1106 accumulate -= tc->th_sport;
1107
1108 sptr = (u_short *) &(pip->ip_src);

--- 478 unchanged lines hidden ---
1107
1108/* Adjust TCP checksum since source port is being aliased */
1109/* and source address is being altered */
1110 accumulate = tc->th_sport;
1111 tc->th_sport = alias_port;
1112 accumulate -= tc->th_sport;
1113
1114 sptr = (u_short *) &(pip->ip_src);

--- 478 unchanged lines hidden ---