1/* $FreeBSD: stable/10/sys/netipsec/ipsec.h 283902 2015-06-02 03:43:36Z ae $ */ |
2/* $KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $ */ 3 4/*- 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 311 unchanged lines hidden (view full) --- 321#define ipseclog(x) do { if (V_ipsec_debug) log x; } while (0) 322/* for openbsd compatibility */ 323#define DPRINTF(x) do { if (V_ipsec_debug) printf x; } while (0) 324 325extern struct ipsecrequest *ipsec_newisr(void); 326extern void ipsec_delisr(struct ipsecrequest *); 327 328struct tdb_ident; |
329extern struct secpolicy *ipsec_getpolicy(struct tdb_ident*, u_int); |
330struct inpcb; |
331extern struct secpolicy *ipsec4_checkpolicy(struct mbuf *, u_int, u_int, 332 int *, struct inpcb *); |
333extern struct secpolicy * ipsec_getpolicybyaddr(struct mbuf *, u_int, 334 int, int *); 335 336struct inpcb; |
337extern int ipsec_init_policy(struct socket *so, struct inpcbpolicy **); 338extern int ipsec_copy_policy(struct inpcbpolicy *, struct inpcbpolicy *); 339extern u_int ipsec_get_reqlevel(struct ipsecrequest *); 340extern int ipsec_in_reject(struct secpolicy *, struct mbuf *); |
341 |
342extern int ipsec_set_policy(struct inpcb *inp, int optname, 343 caddr_t request, size_t len, struct ucred *cred); 344extern int ipsec_get_policy(struct inpcb *inpcb, caddr_t request, 345 size_t len, struct mbuf **mp); 346extern int ipsec_delete_pcbpolicy(struct inpcb *); 347extern int ipsec4_in_reject(struct mbuf *, struct inpcb *); |
348 349struct secas; 350struct tcpcb; |
351extern int ipsec_chkreplay(u_int32_t, struct secasvar *); 352extern int ipsec_updatereplay(u_int32_t, struct secasvar *); |
353 |
354extern size_t ipsec_hdrsiz(struct mbuf *, u_int, struct inpcb *); 355extern size_t ipsec_hdrsiz_tcp(struct tcpcb *); |
356 357union sockaddr_union; 358extern char * ipsec_address(union sockaddr_union* sa); |
359extern const char *ipsec_logsastr(struct secasvar *); |
360 |
361extern void ipsec_dumpmbuf(struct mbuf *); |
362 363struct m_tag; 364extern void ah4_input(struct mbuf *m, int off); 365extern void ah4_ctlinput(int cmd, struct sockaddr *sa, void *); 366extern void esp4_input(struct mbuf *m, int off); 367extern void esp4_ctlinput(int cmd, struct sockaddr *sa, void *); 368extern void ipcomp4_input(struct mbuf *m, int off); 369extern int ipsec4_common_input(struct mbuf *m, ...); 370extern int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, 371 int skip, int protoff, struct m_tag *mt); |
372extern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *, 373 int, int); 374extern int ipsec_process_done(struct mbuf *, struct ipsecrequest *); |
375 |
376extern struct mbuf *ipsec_copypkt(struct mbuf *); |
377 378extern void m_checkalignment(const char* where, struct mbuf *m0, 379 int off, int len); 380extern struct mbuf *m_makespace(struct mbuf *m0, int skip, int hlen, int *off); 381extern caddr_t m_pad(struct mbuf *m, int n); 382extern int m_striphdr(struct mbuf *m, int skip, int hlen); 383 384#ifdef DEV_ENC 385#define ENC_BEFORE 0x0001 386#define ENC_AFTER 0x0002 387#define ENC_IN 0x0100 388#define ENC_OUT 0x0200 389extern int ipsec_filter(struct mbuf **, int, int); 390extern void ipsec_bpf(struct mbuf *, struct secasvar *, int, int); 391#endif 392#endif /* _KERNEL */ 393 394#ifndef _KERNEL |
395extern caddr_t ipsec_set_policy(char *, int); 396extern int ipsec_get_policylen(caddr_t); 397extern char *ipsec_dump_policy(caddr_t, char *); 398extern const char *ipsec_strerror(void); |
399 |
400#endif /* ! KERNEL */ 401 402#endif /* _NETIPSEC_IPSEC_H_ */ |