Style and remove unused stuff.

This commit is contained in:
maxv 2018-04-28 14:01:50 +00:00
parent ab18d0d461
commit 6f320ea66c
2 changed files with 12 additions and 52 deletions

View File

@ -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 @@ ipsec_logsastr(const struct secasvar *sav, char *buf, size_t size)
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,

View File

@ -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 @@ struct secspacq {
#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 ip4_ipsec_ecn;
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 @@ extern int crypto_support;
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 @@ union sockaddr_union;
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 ipsec4_process_packet(struct mbuf *, const struct ipsecrequest *, u_long *);
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 */