Deleted Added
full compact
nat_cmd.c (81033) nat_cmd.c (81634)
1/*-
2 * Copyright (c) 2001 Charles Mott <cmott@scientech.com>
3 * Brian Somers <brian@Awfulhak.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2001 Charles Mott <cmott@scientech.com>
3 * Brian Somers <brian@Awfulhak.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/usr.sbin/ppp/nat_cmd.c 81033 2001-08-02 10:16:32Z brian $
27 * $FreeBSD: head/usr.sbin/ppp/nat_cmd.c 81634 2001-08-14 16:05:52Z brian $
28 */
29
30#include <sys/param.h>
31#include <netinet/in.h>
32#include <arpa/inet.h>
33#include <netdb.h>
34#include <netinet/in_systm.h>
35#include <netinet/in.h>
36#include <netinet/ip.h>
28 */
29
30#include <sys/param.h>
31#include <netinet/in.h>
32#include <arpa/inet.h>
33#include <netdb.h>
34#include <netinet/in_systm.h>
35#include <netinet/in.h>
36#include <netinet/ip.h>
37#include <sys/socket.h>
37#include <sys/un.h>
38
39#include <stdio.h>
40#include <stdlib.h>
41#include <string.h>
42#include <termios.h>
43
44#ifdef LOCALNAT

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

58#include "timer.h"
59#include "fsm.h"
60#include "slcompress.h"
61#include "throughput.h"
62#include "iplist.h"
63#include "mbuf.h"
64#include "lqr.h"
65#include "hdlc.h"
38#include <sys/un.h>
39
40#include <stdio.h>
41#include <stdlib.h>
42#include <string.h>
43#include <termios.h>
44
45#ifdef LOCALNAT

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

59#include "timer.h"
60#include "fsm.h"
61#include "slcompress.h"
62#include "throughput.h"
63#include "iplist.h"
64#include "mbuf.h"
65#include "lqr.h"
66#include "hdlc.h"
67#include "ncpaddr.h"
68#include "ip.h"
66#include "ipcp.h"
69#include "ipcp.h"
70#include "ipv6cp.h"
67#include "lcp.h"
68#include "ccp.h"
69#include "link.h"
70#include "mp.h"
71#include "filter.h"
72#ifndef NORADIUS
73#include "radius.h"
74#endif
71#include "lcp.h"
72#include "ccp.h"
73#include "link.h"
74#include "mp.h"
75#include "filter.h"
76#ifndef NORADIUS
77#include "radius.h"
78#endif
75#include "ip.h"
79#include "ncp.h"
76#include "bundle.h"
77
78
79#define NAT_EXTRABUF (13)
80
81static int StrToAddr(const char *, struct in_addr *);
82static int StrToPortRange(const char *, u_short *, u_short *, const char *);
83static int StrToAddrAndPort(const char *, struct in_addr *, u_short *,

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

542
543 case PKT_ALIAS_IGNORED:
544 if (PacketAliasSetMode(0, 0) & PKT_ALIAS_DENY_INCOMING) {
545 log_Printf(LogTCPIP, "NAT engine denied data:\n");
546 m_freem(bp);
547 bp = NULL;
548 } else if (log_IsKept(LogTCPIP)) {
549 log_Printf(LogTCPIP, "NAT engine ignored data:\n");
80#include "bundle.h"
81
82
83#define NAT_EXTRABUF (13)
84
85static int StrToAddr(const char *, struct in_addr *);
86static int StrToPortRange(const char *, u_short *, u_short *, const char *);
87static int StrToAddrAndPort(const char *, struct in_addr *, u_short *,

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

546
547 case PKT_ALIAS_IGNORED:
548 if (PacketAliasSetMode(0, 0) & PKT_ALIAS_DENY_INCOMING) {
549 log_Printf(LogTCPIP, "NAT engine denied data:\n");
550 m_freem(bp);
551 bp = NULL;
552 } else if (log_IsKept(LogTCPIP)) {
553 log_Printf(LogTCPIP, "NAT engine ignored data:\n");
550 PacketCheck(bundle, MBUF_CTOP(bp), bp->m_len, NULL, NULL, NULL);
554 PacketCheck(bundle, AF_INET, MBUF_CTOP(bp), bp->m_len, NULL,
555 NULL, NULL);
551 }
552 break;
553
554 default:
555 log_Printf(LogWARN, "nat_LayerPull: Dropped a packet (%d)....\n", ret);
556 m_freem(bp);
557 bp = NULL;
558 break;
559 }
560
561 return bp;
562}
563
564struct layer natlayer =
565 { LAYER_NAT, "nat", nat_LayerPush, nat_LayerPull };
556 }
557 break;
558
559 default:
560 log_Printf(LogWARN, "nat_LayerPull: Dropped a packet (%d)....\n", ret);
561 m_freem(bp);
562 bp = NULL;
563 break;
564 }
565
566 return bp;
567}
568
569struct layer natlayer =
570 { LAYER_NAT, "nat", nat_LayerPush, nat_LayerPull };