The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netinet6/ip6_divert.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $OpenBSD: ip6_divert.h,v 1.22 2022/10/17 14:49:02 mvs Exp $ */
    2 
    3 /*
    4  * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
    5  *
    6  * Permission to use, copy, modify, and distribute this software for any
    7  * purpose with or without fee is hereby granted, provided that the above
    8  * copyright notice and this permission notice appear in all copies.
    9  *
   10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   17  */
   18 
   19 #ifndef _IP6_DIVERT_H_
   20 #define _IP6_DIVERT_H_
   21 
   22 struct div6stat {
   23         u_long  divs_ipackets;  /* total input packets */
   24         u_long  divs_noport;    /* no socket on port */
   25         u_long  divs_fullsock;  /* not delivered, input socket full */
   26         u_long  divs_opackets;  /* total output packets */
   27         u_long  divs_errors;    /* generic errors */
   28 };
   29 
   30 /*
   31  * Names for divert sysctl objects
   32  */
   33 #define DIVERT6CTL_RECVSPACE    1       /* receive buffer space */
   34 #define DIVERT6CTL_SENDSPACE    2       /* send buffer space */
   35 #define DIVERT6CTL_STATS        3       /* divert statistics */
   36 #define DIVERT6CTL_MAXID        4
   37 
   38 #define DIVERT6CTL_NAMES { \
   39         { 0, 0 }, \
   40         { "recvspace",  CTLTYPE_INT }, \
   41         { "sendspace",  CTLTYPE_INT }, \
   42         { "stats",      CTLTYPE_STRUCT } \
   43 }
   44 
   45 #ifdef _KERNEL
   46 
   47 #include <sys/percpu.h>
   48 
   49 enum div6stat_counters {
   50         div6s_ipackets,
   51         div6s_noport,
   52         div6s_fullsock,
   53         div6s_opackets,
   54         div6s_errors,
   55         div6s_ncounters,
   56 };
   57 
   58 extern struct cpumem *div6counters;
   59 
   60 static inline void
   61 div6stat_inc(enum div6stat_counters c)
   62 {
   63         counters_inc(div6counters, c);
   64 }
   65 
   66 extern struct   inpcbtable      divb6table;
   67 
   68 extern const struct pr_usrreqs divert6_usrreqs;
   69 
   70 void     divert6_init(void);
   71 void     divert6_packet(struct mbuf *, int, u_int16_t);
   72 int      divert6_sysctl(int *, u_int, void *, size_t *, void *, size_t);
   73 int      divert6_attach(struct socket *, int, int);
   74 int      divert6_detach(struct socket *);
   75 void     divert6_lock(struct socket *);
   76 void     divert6_unlock(struct socket *);
   77 int      divert6_bind(struct socket *, struct mbuf *, struct proc *);
   78 int      divert6_shutdown(struct socket *);
   79 int      divert6_send(struct socket *, struct mbuf *, struct mbuf *,
   80              struct mbuf *);
   81 #endif /* _KERNEL */
   82 
   83 #endif /* _IP6_DIVERT_H_ */

Cache object: a213cad50fa196bd49e34bc9c756a305


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.