ipsec.h (283901) | ipsec.h (283902) |
---|---|
1/* $FreeBSD: stable/10/sys/netipsec/ipsec.h 283901 2015-06-02 03:14:42Z ae $ */ | 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; | 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 __P((struct tdb_ident*, u_int)); | 329extern struct secpolicy *ipsec_getpolicy(struct tdb_ident*, u_int); |
330struct inpcb; | 330struct inpcb; |
331extern struct secpolicy *ipsec4_checkpolicy __P((struct mbuf *, u_int, u_int, 332 int *, struct 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; | 333extern struct secpolicy * ipsec_getpolicybyaddr(struct mbuf *, u_int, 334 int, int *); 335 336struct inpcb; |
337extern int ipsec_init_policy __P((struct socket *so, struct inpcbpolicy **)); 338extern int ipsec_copy_policy 339 __P((struct inpcbpolicy *, struct inpcbpolicy *)); 340extern u_int ipsec_get_reqlevel __P((struct ipsecrequest *)); 341extern int ipsec_in_reject __P((struct secpolicy *, struct mbuf *)); | 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 *); |
342 | 341 |
343extern int ipsec_set_policy __P((struct inpcb *inp, int optname, 344 caddr_t request, size_t len, struct ucred *cred)); 345extern int ipsec_get_policy __P((struct inpcb *inpcb, caddr_t request, 346 size_t len, struct mbuf **mp)); 347extern int ipsec_delete_pcbpolicy __P((struct inpcb *)); 348extern int ipsec4_in_reject __P((struct mbuf *, struct inpcb *)); | 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 *); |
349 350struct secas; 351struct tcpcb; | 348 349struct secas; 350struct tcpcb; |
352extern int ipsec_chkreplay __P((u_int32_t, struct secasvar *)); 353extern int ipsec_updatereplay __P((u_int32_t, struct secasvar *)); | 351extern int ipsec_chkreplay(u_int32_t, struct secasvar *); 352extern int ipsec_updatereplay(u_int32_t, struct secasvar *); |
354 | 353 |
355extern size_t ipsec_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); 356extern size_t ipsec_hdrsiz_tcp __P((struct tcpcb *)); | 354extern size_t ipsec_hdrsiz(struct mbuf *, u_int, struct inpcb *); 355extern size_t ipsec_hdrsiz_tcp(struct tcpcb *); |
357 358union sockaddr_union; 359extern char * ipsec_address(union sockaddr_union* sa); | 356 357union sockaddr_union; 358extern char * ipsec_address(union sockaddr_union* sa); |
360extern const char *ipsec_logsastr __P((struct secasvar *)); | 359extern const char *ipsec_logsastr(struct secasvar *); |
361 | 360 |
362extern void ipsec_dumpmbuf __P((struct mbuf *)); | 361extern void ipsec_dumpmbuf(struct mbuf *); |
363 364struct m_tag; 365extern void ah4_input(struct mbuf *m, int off); 366extern void ah4_ctlinput(int cmd, struct sockaddr *sa, void *); 367extern void esp4_input(struct mbuf *m, int off); 368extern void esp4_ctlinput(int cmd, struct sockaddr *sa, void *); 369extern void ipcomp4_input(struct mbuf *m, int off); 370extern int ipsec4_common_input(struct mbuf *m, ...); 371extern int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, 372 int skip, int protoff, struct m_tag *mt); | 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); |
373extern int ipsec4_process_packet __P((struct mbuf *, struct ipsecrequest *, 374 int, int)); 375extern int ipsec_process_done __P((struct mbuf *, struct ipsecrequest *)); | 372extern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *, 373 int, int); 374extern int ipsec_process_done(struct mbuf *, struct ipsecrequest *); |
376 | 375 |
377extern struct mbuf *ipsec_copypkt __P((struct mbuf *)); | 376extern struct mbuf *ipsec_copypkt(struct mbuf *); |
378 379extern void m_checkalignment(const char* where, struct mbuf *m0, 380 int off, int len); 381extern struct mbuf *m_makespace(struct mbuf *m0, int skip, int hlen, int *off); 382extern caddr_t m_pad(struct mbuf *m, int n); 383extern int m_striphdr(struct mbuf *m, int skip, int hlen); 384 385#ifdef DEV_ENC 386#define ENC_BEFORE 0x0001 387#define ENC_AFTER 0x0002 388#define ENC_IN 0x0100 389#define ENC_OUT 0x0200 390extern int ipsec_filter(struct mbuf **, int, int); 391extern void ipsec_bpf(struct mbuf *, struct secasvar *, int, int); 392#endif 393#endif /* _KERNEL */ 394 395#ifndef _KERNEL | 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 |
396extern caddr_t ipsec_set_policy __P((char *, int)); 397extern int ipsec_get_policylen __P((caddr_t)); 398extern char *ipsec_dump_policy __P((caddr_t, char *)); | 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 | 399 |
400extern const char *ipsec_strerror __P((void)); 401 | |
402#endif /* ! KERNEL */ 403 404#endif /* _NETIPSEC_IPSEC_H_ */ | 400#endif /* ! KERNEL */ 401 402#endif /* _NETIPSEC_IPSEC_H_ */ |