summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-08-22 15:17:03 +0000
committerhenning <henning@openbsd.org>2003-08-22 15:17:03 +0000
commit2f4329ee0af89ce425ee8748aabe99488c6e681f (patch)
tree7a285bf7940422dd5ff97a7474437de05f3049ca
parentdon't expose pf_osfp_fingerprint() to ! _KERNEL. tcpdump et al use (diff)
downloadwireguard-openbsd-2f4329ee0af89ce425ee8748aabe99488c6e681f.tar.xz
wireguard-openbsd-2f4329ee0af89ce425ee8748aabe99488c6e681f.zip
KNF
-rw-r--r--sbin/pfctl/pfctl_osfp.c66
-rw-r--r--sys/net/pf_norm.c4
-rw-r--r--sys/net/pf_table.c12
-rw-r--r--sys/net/pfvar.h4
4 files changed, 43 insertions, 43 deletions
diff --git a/sbin/pfctl/pfctl_osfp.c b/sbin/pfctl/pfctl_osfp.c
index d8045239bd2..24cfabd0d9e 100644
--- a/sbin/pfctl/pfctl_osfp.c
+++ b/sbin/pfctl/pfctl_osfp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_osfp.c,v 1.1 2003/08/21 19:12:08 frantzen Exp $ */
+/* $OpenBSD: pfctl_osfp.c,v 1.2 2003/08/22 15:17:03 henning Exp $ */
/*
* Copyright (c) 2003 Mike Frantzen <frantzen@openbsd.org>
@@ -63,21 +63,21 @@ struct name_list classes = LIST_HEAD_INITIALIZER(&classes);
int class_count;
int fingerprint_count;
-void add_fingerprint(int, int, struct pf_osfp_ioctl *);
-struct name_entry *fingerprint_name_entry(struct name_list *, char *);
+void add_fingerprint(int, int, struct pf_osfp_ioctl *);
+struct name_entry *fingerprint_name_entry(struct name_list *, char *);
void pfctl_flush_my_fingerprints(struct name_list *);
char *get_field(char **, size_t *, int *);
-int get_int(char **, size_t *, int *, int *, const char *,
+int get_int(char **, size_t *, int *, int *, const char *,
int, int, const char *, int);
-int get_str(char **, size_t *, char **, const char *, int,
+int get_str(char **, size_t *, char **, const char *, int,
const char *, int);
int get_tcpopts(const char *, int, const char *,
pf_tcpopts_t *, int *, int *, int *, int *, int *,
int *);
void import_fingerprint(struct pf_osfp_ioctl *);
-const char *print_ioctl(struct pf_osfp_ioctl *);
-void print_name_list(int, struct name_list *, const char *);
-void sort_name_list(int, struct name_list *);
+const char *print_ioctl(struct pf_osfp_ioctl *);
+void print_name_list(int, struct name_list *, const char *);
+void sort_name_list(int, struct name_list *);
struct name_entry *lookup_name_list(struct name_list *, const char *);
/* Load fingerprints from a file */
@@ -216,7 +216,7 @@ pfctl_file_fingerprints(int dev, int opts, const char *fp_filename)
break;
}
fp.fp_mss = mss;
-
+
fp.fp_tcpopts = packed_tcpopts;
fp.fp_optcnt = optcnt;
if (ts0)
@@ -542,41 +542,41 @@ add_fingerprint(int dev, int opts, struct pf_osfp_ioctl *fp)
_dot = fp->field[_i] - '0'; \
_i += 2; \
} \
- if (isdigit(fp->field[_i])) \
- _start = fp->field[_i++] - '0'; \
- else \
- break; \
- if (isdigit(fp->field[_i])) \
+ if (isdigit(fp->field[_i])) \
+ _start = fp->field[_i++] - '0'; \
+ else \
+ break; \
+ if (isdigit(fp->field[_i])) \
_start = (_start * 10) + fp->field[_i++] - '0'; \
if (fp->field[_i++] != '-') \
- break; \
+ break; \
if (isdigit(fp->field[_i]) && fp->field[_i+1] == '.' && \
fp->field[_i] - '0' == _dot) \
_i += 2; \
else if (_dot != -1) \
break; \
- if (isdigit(fp->field[_i])) \
- _end = fp->field[_i++] - '0'; \
- else \
- break; \
- if (isdigit(fp->field[_i])) \
- _end = (_end * 10) + fp->field[_i++] - '0'; \
- if (isdigit(fp->field[_i])) \
- _end = (_end * 10) + fp->field[_i++] - '0'; \
- if (fp->field[_i] != '\0') \
- break; \
- memcpy(&fptmp, fp, sizeof(fptmp)); \
- for (;_start <= _end; _start++) { \
+ if (isdigit(fp->field[_i])) \
+ _end = fp->field[_i++] - '0'; \
+ else \
+ break; \
+ if (isdigit(fp->field[_i])) \
+ _end = (_end * 10) + fp->field[_i++] - '0'; \
+ if (isdigit(fp->field[_i])) \
+ _end = (_end * 10) + fp->field[_i++] - '0'; \
+ if (fp->field[_i] != '\0') \
+ break; \
+ memcpy(&fptmp, fp, sizeof(fptmp)); \
+ for (;_start <= _end; _start++) { \
memset(fptmp.field, 0, sizeof(fptmp.field)); \
fptmp.fp_os.fp_enflags |= PF_OSFP_EXPANDED; \
if (_dot == -1) \
snprintf(fptmp.field, sizeof(fptmp.field), \
- "%d", _start); \
+ "%d", _start); \
else \
snprintf(fptmp.field, sizeof(fptmp.field), \
- "%d.%d", _dot, _start); \
- add_fingerprint(dev, opts, &fptmp); \
- } \
+ "%d.%d", _dot, _start); \
+ add_fingerprint(dev, opts, &fptmp); \
+ } \
} while(0)
/* We allow "#-#" as a version or subtype and we'll expand it */
@@ -588,7 +588,7 @@ add_fingerprint(int dev, int opts, struct pf_osfp_ioctl *fp)
version = PF_OSFP_ANY;
subtype = PF_OSFP_ANY;
-
+
nm_class = fingerprint_name_entry(&classes, fp->fp_os.fp_class_nm);
if (nm_class->nm_num == 0)
nm_class->nm_num = ++class_count;
@@ -889,7 +889,7 @@ get_tcpopts(const char *filename, int lineno, const char *tcpopts,
*mss_mod = T_DC;
*ts0 = 0;
if (strcmp(tcpopts, ".") == 0)
- return(0);
+ return (0);
for (i = 0; tcpopts[i] && *optcnt < PF_OSFP_MAX_OPTS;) {
switch ((opt = toupper(tcpopts[i++]))) {
diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c
index 4ef322954ac..fdee9ba6dca 100644
--- a/sys/net/pf_norm.c
+++ b/sys/net/pf_norm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_norm.c,v 1.72 2003/08/21 19:12:08 frantzen Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.73 2003/08/22 15:19:23 henning Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -881,7 +881,7 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct ifnet *ifp, u_short *reason)
DPFPRINTF(("max packet %d\n", fragoff + ip_len));
goto bad;
}
- max = fragoff + ip_len;
+ max = fragoff + ip_len;
if ((r->rule_flag & (PFRULE_FRAGCROP|PFRULE_FRAGDROP)) == 0) {
/* Fully buffer all of the fragments */
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c
index d5f44375126..e6ce25fa46e 100644
--- a/sys/net/pf_table.c
+++ b/sys/net/pf_table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_table.c,v 1.40 2003/08/09 14:56:48 cedric Exp $ */
+/* $OpenBSD: pf_table.c,v 1.41 2003/08/22 15:19:23 henning Exp $ */
/*
* Copyright (c) 2002 Cedric Berger
@@ -1917,7 +1917,7 @@ pfr_detach_table(struct pfr_ktable *kt)
pfr_setflags_ktable(kt, kt->pfrkt_flags&~PFR_TFLAG_REFERENCED);
}
-int
+int
pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter,
struct pf_addr **raddr, struct pf_addr **rmask, sa_family_t af)
{
@@ -1950,7 +1950,7 @@ _next_block:
if (use_counter) {
/* is supplied address within block? */
- if(!PF_MATCHA(0, *raddr, *rmask, counter, af)) {
+ if (!PF_MATCHA(0, *raddr, *rmask, counter, af)) {
/* no, go to next block in table */
idx++;
use_counter = 0;
@@ -1968,7 +1968,7 @@ _next_block:
*pidx = idx;
return (0);
}
- for(;;) {
+ for (;;) {
/* we don't want to use a nested block */
ke2 = (struct pfr_kentry *)(af == AF_INET ?
rn_match(&pfr_sin, kt->pfrkt_ip4) :
@@ -1985,7 +1985,7 @@ _next_block:
pfr_prepare_network(&mask, AF_INET, ke2->pfrke_net);
PF_POOLMASK(addr, addr, SUNION2PF(&mask, af), &pfr_ffaddr, af);
PF_AINC(addr, af);
- if(!PF_MATCHA(0, *raddr, *rmask, addr, af)) {
+ if (!PF_MATCHA(0, *raddr, *rmask, addr, af)) {
/* ok, we reached the end of our main block */
/* go to next block in table */
idx++;
@@ -2006,7 +2006,7 @@ pfr_kentry_byidx(struct pfr_ktable *kt, int idx, int af)
switch(af) {
case AF_INET:
- rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
+ rn_walktree(kt->pfrkt_ip4, pfr_walktree, &w);
return w.pfrw_kentry;
case AF_INET6:
rn_walktree(kt->pfrkt_ip6, pfr_walktree, &w);
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 136b359bb20..d39894da2ac 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.168 2003/08/22 14:59:30 frantzen Exp $ */
+/* $OpenBSD: pfvar.h,v 1.169 2003/08/22 15:19:23 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -412,7 +412,7 @@ struct pf_os_fingerprint {
};
struct pf_osfp_ioctl {
- struct pf_osfp_entry fp_os;
+ struct pf_osfp_entry fp_os;
pf_tcpopts_t fp_tcpopts; /* packed TCP options */
u_int16_t fp_wsize; /* TCP window size */
u_int16_t fp_psize; /* ip->ip_len */