Style and remove unused stuff. trunk
authormaxv <maxv@NetBSD.org>
Sat, 28 Apr 2018 14:01:50 +0000
branchtrunk
changeset 318533 3791c1e92e21
parent 318532 0b70c9cd9611
child 318534 ed5233f21e2f
Style and remove unused stuff.
sys/netipsec/ipsec.c
sys/netipsec/ipsec.h
--- a/sys/netipsec/ipsec.c	Sat Apr 28 13:44:19 2018 +0000
+++ b/sys/netipsec/ipsec.c	Sat Apr 28 14:01:50 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.157 2018/04/19 08:27:38 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.158 2018/04/28 14:01:50 maxv Exp $ */
 /* $FreeBSD: ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.157 2018/04/19 08:27:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.158 2018/04/28 14:01:50 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -1814,30 +1814,6 @@
 	return buf;
 }
 
-void
-ipsec_dumpmbuf(struct mbuf *m)
-{
-	int totlen;
-	int i;
-	u_char *p;
-
-	totlen = 0;
-	printf("---\n");
-	while (m) {
-		p = mtod(m, u_char *);
-		for (i = 0; i < m->m_len; i++) {
-			printf("%02x ", p[i]);
-			totlen++;
-			if (totlen % 16 == 0)
-				printf("\n");
-		}
-		m = m->m_next;
-	}
-	if (totlen % 16 != 0)
-		printf("\n");
-	printf("---\n");
-}
-
 #ifdef INET6
 struct secpolicy *
 ipsec6_check_policy(struct mbuf *m, struct in6pcb *in6p, int flags,
--- a/sys/netipsec/ipsec.h	Sat Apr 28 13:44:19 2018 +0000
+++ b/sys/netipsec/ipsec.h	Sat Apr 28 14:01:50 2018 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.74 2018/04/19 21:50:10 christos Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.75 2018/04/28 14:01:50 maxv Exp $	*/
 /*	$FreeBSD: ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
 
@@ -31,10 +31,6 @@
  * SUCH DAMAGE.
  */
 
-/*
- * IPsec controller part.
- */
-
 #ifndef _NETIPSEC_IPSEC_H_
 #define _NETIPSEC_IPSEC_H_
 
@@ -227,16 +223,6 @@
 #define IPSEC_REPLAYWSIZE  32
 
 #ifdef _KERNEL
-struct ipsec_output_state {
-	struct mbuf *m;
-	struct route *ro;
-	struct sockaddr *dst;
-};
-
-struct ipsec_history {
-	int ih_proto;
-	u_int32_t ih_spi;
-};
 
 extern int ipsec_debug;
 #ifdef IPSEC_DEBUG
@@ -256,8 +242,7 @@
 extern int crypto_support;
 
 #include <sys/syslog.h>
-#define ipseclog(x)	do { if (ipsec_debug) log x; } while (0)
-/* for openbsd compatibility */
+
 #define	DPRINTF(x)	do { if (ipsec_debug) printf x; } while (0)
 
 #define IPSECLOG(level, fmt, args...) 					\
@@ -266,6 +251,11 @@
 			log(level, "%s: " fmt, __func__, ##args);	\
 	} while (0)
 
+#define ipsec_indone(m)	\
+	((m->m_flags & M_AUTHIPHDR) || (m->m_flags & M_DECRYPTED))
+#define ipsec_outdone(m) \
+	(m_tag_find((m), PACKET_TAG_IPSEC_OUT_DONE, NULL) != NULL)
+
 void ipsec_pcbconn(struct inpcbpolicy *);
 void ipsec_pcbdisconn(struct inpcbpolicy *);
 void ipsec_invalpcbcacheall(void);
@@ -304,8 +294,6 @@
 const char *ipsec_address(const union sockaddr_union* sa, char *, size_t);
 const char *ipsec_logsastr(const struct secasvar *, char *, size_t);
 
-void ipsec_dumpmbuf(struct mbuf *);
-
 /* NetBSD protosw ctlin entrypoint */
 void *esp4_ctlinput(int, const struct sockaddr *, void *);
 void *ah4_ctlinput(int, const struct sockaddr *, void *);
@@ -318,19 +306,15 @@
 int ipsec_process_done(struct mbuf *, const struct ipsecrequest *,
     struct secasvar *);
 
-#define ipsec_indone(m)	\
-	((m->m_flags & M_AUTHIPHDR) || (m->m_flags & M_DECRYPTED))
-#define ipsec_outdone(m) \
-	(m_tag_find((m), PACKET_TAG_IPSEC_OUT_DONE, NULL) != NULL)
-
 struct mbuf *m_clone(struct mbuf *);
 struct mbuf *m_makespace(struct mbuf *, int, int, int *);
-void *m_pad(struct mbuf *, int );
+void *m_pad(struct mbuf *, int);
 int m_striphdr(struct mbuf *, int, int);
 
 void nat_t_ports_get(struct mbuf *, u_int16_t *, u_int16_t *);
 
-extern int ipsec_used __read_mostly, ipsec_enabled __read_mostly;
+extern int ipsec_used __read_mostly;
+extern int ipsec_enabled __read_mostly;
 
 #endif /* _KERNEL */