aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/filter.h
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2001-08-14 16:05:52 +0000
committerBrian Somers <brian@FreeBSD.org>2001-08-14 16:05:52 +0000
commit30949fd4b52d91188c23cb2ca0d130d89bb1678c (patch)
treeb09d46345a558a45e66b435c4386d76cf53405d3 /usr.sbin/ppp/filter.h
parent135047c346cac167948b8cbbe9529d74ef0b7dad (diff)
downloadsrc-30949fd4b52d91188c23cb2ca0d130d89bb1678c.tar.gz
src-30949fd4b52d91188c23cb2ca0d130d89bb1678c.zip
o Add ipv6 support, abstracting most NCP addresses into opaque
structures (well, they're treated as opaque). It's now possible to manage IPv6 interface addresses and routing table entries and to filter IPV6 traffic whether encapsulated or not. IPV6CP support is crude for now, and hasn't been tested against any other implementations. RADIUS and IPv6 are independent of eachother for now. ppp.linkup/ppp.linkdown aren't currently used by IPV6CP o Understand all protocols(5) in filter rules rather than only a select few. o Allow a mask specification for the ``delete'' command. It's now possible to specifically delete one of two conflicting routes. o When creating and deleting proxy arp entries, do it for all IPv4 interface addresses rather than doing it just for the ``current'' peer address. o When iface-alias isn't in effect, don't blow away manually (via ``iface add'') added interface addresses. o When listening on a tcp server (diagnostic) socket, bind so that a tcp46 socket is created -- allowing both IPv4 and IPv6 connections. o When displaying ICMP traffic, don't display the icmp type twice. When display traffic, display at least some information about unrecognised traffic. o Bump version Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
Notes
Notes: svn path=/head/; revision=81634
Diffstat (limited to 'usr.sbin/ppp/filter.h')
-rw-r--r--usr.sbin/ppp/filter.h45
1 files changed, 11 insertions, 34 deletions
diff --git a/usr.sbin/ppp/filter.h b/usr.sbin/ppp/filter.h
index 5f22835a8e51..f994f4b0417d 100644
--- a/usr.sbin/ppp/filter.h
+++ b/usr.sbin/ppp/filter.h
@@ -28,22 +28,6 @@
* $FreeBSD$
*/
-/* Known protocols - f_proto */
-#define P_NONE 0
-#define P_TCP 1
-#define P_UDP 2
-#define P_ICMP 3
-#ifdef IPPROTO_OSPFIGP
-#define P_OSPF 4
-#endif
-#define P_IGMP 5
-#ifdef IPPROTO_GRE
-#define P_GRE 6
-#endif
-#define P_ESP 7
-#define P_AH 8
-#define P_IPIP 9
-
/* Operations - f_srcop, f_dstop */
#define OP_NONE 0
#define OP_EQ 1
@@ -53,9 +37,11 @@
/* srctype or dsttype */
#define T_ADDR 0
#define T_MYADDR 1
-#define T_HISADDR 2
-#define T_DNS0 3
-#define T_DNS1 4
+#define T_MYADDR6 2
+#define T_HISADDR 3
+#define T_HISADDR6 4
+#define T_DNS0 5
+#define T_DNS1 6
/*
* There's a struct filterent for each possible filter rule. The
@@ -63,17 +49,12 @@
* them) - which is also conveniently a power of 2 (32 bytes) on
* architectures where sizeof(int)==4 (this makes indexing faster).
*
- * f_action and f_proto only need to be 6 and 3 bits, respectively,
- * but making them 8 bits allows them to be efficently accessed using
- * byte operations as well as allowing space for future expansion
- * (expanding MAXFILTERS or converting f_proto IPPROTO_... values).
- *
* Note that there are four free bits in the initial word for future
* extensions.
*/
struct filterent {
- unsigned f_action : 8; /* Filtering action: goto or A_... */
- unsigned f_proto : 8; /* Protocol: P_... */
+ int f_proto; /* Protocol: getprotoby*() */
+ unsigned f_action : 8; /* Filtering action: goto or A_... */
unsigned f_srcop : 2; /* Source port operation: OP_... */
unsigned f_dstop : 2; /* Destination port operation: OP_... */
unsigned f_srctype : 3; /* T_ value of src */
@@ -82,8 +63,8 @@ struct filterent {
unsigned f_syn : 1; /* Check TCP SYN bit */
unsigned f_finrst : 1; /* Check TCP FIN/RST bits */
unsigned f_invert : 1; /* true to complement match */
- struct in_range f_src; /* Source address and mask */
- struct in_range f_dst; /* Destination address and mask */
+ struct ncprange f_src; /* Source address and mask */
+ struct ncprange f_dst; /* Destination address and mask */
u_short f_srcport; /* Source port, compared with f_srcop */
u_short f_dstport; /* Destination port, compared with f_dstop */
unsigned timeout; /* Keep alive value for passed packet */
@@ -112,13 +93,9 @@ struct filter {
struct ipcp;
struct cmdargs;
-extern int ParseAddr(struct ipcp *, const char *, struct in_addr *,
- struct in_addr *, int *);
extern int filter_Show(struct cmdargs const *);
extern int filter_Set(struct cmdargs const *);
extern const char * filter_Action2Nam(int);
-extern const char *filter_Proto2Nam(int);
extern const char *filter_Op2Nam(int);
-extern struct in_addr bits2mask(int);
-extern void filter_AdjustAddr(struct filter *, struct in_addr *,
- struct in_addr *, struct in_addr [2]);
+extern void filter_AdjustAddr(struct filter *, struct ncpaddr *,
+ struct ncpaddr *, struct in_addr *);