Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/net Pull up revision 1.51, 1.53 (requested by bouyer):



details:   https://anonhg.NetBSD.org/src/rev/7f0045c3caba
branches:  netbsd-1-5
changeset: 490445:7f0045c3caba
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Sun Dec 31 17:57:43 2000 +0000

description:
Pull up revision 1.51, 1.53 (requested by bouyer):
  Support cloning of network pseudo-interfaces.

diffstat:

 sys/net/if.h |  47 +++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 39 insertions(+), 8 deletions(-)

diffs (75 lines):

diff -r c157be7c647d -r 7f0045c3caba sys/net/if.h
--- a/sys/net/if.h      Sun Dec 31 17:57:40 2000 +0000
+++ b/sys/net/if.h      Sun Dec 31 17:57:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.50 2000/05/15 16:59:37 itojun Exp $   */
+/*     $NetBSD: if.h,v 1.50.4.1 2000/12/31 17:57:43 jhawk Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -114,6 +114,38 @@
 struct rtentry;
 struct socket;
 struct ether_header;
+struct ifnet;
+
+/*
+ * Length of interface external name, including terminating '\0'.
+ * Note: this is the same size as a generic device's external name.
+ */
+#define        IFNAMSIZ        16
+#define        IF_NAMESIZE     IFNAMSIZ
+
+/*
+ * Structure describing a `cloning' interface.
+ */
+struct if_clone {
+       LIST_ENTRY(if_clone) ifc_list;  /* on list of cloners */
+       const char *ifc_name;           /* name of device, e.g. `gif' */
+       size_t ifc_namelen;             /* length of name */
+
+       int     (*ifc_create)(struct if_clone *, int);
+       void    (*ifc_destroy)(struct ifnet *);
+};
+
+#define        IF_CLONE_INITIALIZER(name, create, destroy)                     \
+       { { 0 }, name, sizeof(name) - 1, create, destroy }
+
+/*
+ * Structure used to query names of interface cloners.
+ */
+struct if_clonereq {
+       int     ifcr_total;             /* total cloners (out) */
+       int     ifcr_count;             /* room for this many in user buffer */
+       char    *ifcr_buffer;           /* buffer for cloner names */
+};
 
 /*
  * Structure defining statistics and other data kept regarding a network
@@ -183,13 +215,6 @@
  */
 TAILQ_HEAD(ifnet_head, ifnet);         /* the actual queue head */
 
-/*
- * Length of interface external name, including terminating '\0'.
- * Note: this is the same size as a generic device's external name.
- */
-#define        IFNAMSIZ        16
-#define        IF_NAMESIZE     IFNAMSIZ
-
 struct ifnet {                         /* and the entries */
        void    *if_softc;              /* lower-level data for this if */
        TAILQ_ENTRY(ifnet) if_list;     /* all struct ifnets are chained */
@@ -582,6 +607,12 @@
 void   ifafree __P((struct ifaddr *));
 void   link_rtrequest __P((int, struct rtentry *, struct sockaddr *));
 
+void   if_clone_attach __P((struct if_clone *));
+void   if_clone_detach __P((struct if_clone *));
+
+int    if_clone_create __P((const char *));
+int    if_clone_destroy __P((const char *));
+
 int    loioctl __P((struct ifnet *, u_long, caddr_t));
 void   loopattach __P((int));
 int    looutput __P((struct ifnet *,



Home | Main Index | Thread Index | Old Index