Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Add support for PPPOEGETPARMS and PPPOES...



details:   https://anonhg.NetBSD.org/src/rev/d75befe36bab
branches:  trunk
changeset: 338607:d75befe36bab
user:      roy <roy%NetBSD.org@localhost>
date:      Sun May 31 22:19:41 2015 +0000

description:
Add support for PPPOEGETPARMS and PPPOESETPARMS.

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  44 ++++++++++++++++++++++++++++++++++-
 sys/compat/netbsd32/netbsd32_ioctl.h |  14 ++++++++++-
 2 files changed, 55 insertions(+), 3 deletions(-)

diffs (115 lines):

diff -r b58b46450b23 -r d75befe36bab sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Sun May 31 22:16:16 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Sun May 31 22:19:41 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.76 2015/05/31 22:16:16 roy Exp $  */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.77 2015/05/31 22:19:41 roy Exp $  */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,8 +31,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.76 2015/05/31 22:16:16 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.77 2015/05/31 22:19:41 roy Exp $");
 
+#include "pppoe.h"
 #include "sppp.h"
 
 #include <sys/param.h>
@@ -67,6 +68,9 @@
 #include <net/if.h>
 #include <net/route.h>
 
+#if NPPPOE > 0
+#include <net/if_pppoe.h>
+#endif
 #if NSPPP > 0
 #include <net/if_sppp.h>
 #endif
@@ -165,6 +169,21 @@
        p->ifm_ulist = (int *)NETBSD32PTR64(s32p->ifm_ulist);
 }
 
+#if NPPPOE > 0
+static inline void
+netbsd32_to_pppoediscparms(struct netbsd32_pppoediscparms *s32p,
+    struct pppoediscparms *p, u_long cmd)
+{
+
+       memcpy(p->ifname, s32p->ifname, sizeof p->ifname);
+       memcpy(p->eth_ifname, s32p->eth_ifname, sizeof p->eth_ifname);
+       p->ac_name = (char *)NETBSD32PTR64(s32p->ac_name);
+       p->ac_name_len = s32p->ac_name_len;
+       p->service_name = (char *)NETBSD32PTR64(s32p->service_name);
+       p->service_name_len = s32p->service_name_len;
+}
+#endif
+
 #if NSPPP > 0
 static inline void
 netbsd32_to_spppauthcfg(struct netbsd32_spppauthcfg *s32p,
@@ -529,6 +548,21 @@
 #endif
 }
 
+#if NPPPOE > 0
+static inline void
+netbsd32_from_pppoediscparms(struct pppoediscparms *p,
+    struct netbsd32_pppoediscparms *s32p, u_long cmd)
+{
+
+       memcpy(s32p->ifname, p->ifname, sizeof s32p->ifname);
+       memcpy(s32p->eth_ifname, p->eth_ifname, sizeof s32p->eth_ifname);
+       NETBSD32PTR32(s32p->ac_name, p->ac_name);
+       s32p->ac_name_len = p->ac_name_len;
+       NETBSD32PTR32(s32p->service_name, p->service_name);
+       s32p->service_name_len = p->service_name_len;
+}
+#endif
+
 #if NSPPP > 0
 static inline void
 netbsd32_from_spppauthcfg(struct spppauthcfg *p,
@@ -1090,6 +1124,12 @@
        case SIOCGIFMEDIA32:
                IOCTL_STRUCT_CONV_TO(SIOCGIFMEDIA, ifmediareq);
 
+#if NPPPOE > 0
+       case PPPOESETPARMS32:
+               IOCTL_STRUCT_CONV_TO(PPPOESETPARMS, pppoediscparms);
+       case PPPOEGETPARMS32:
+               IOCTL_STRUCT_CONV_TO(PPPOEGETPARMS, pppoediscparms);
+#endif
 #if NSPPP > 0
        case SPPPGETAUTHCFG32:
                IOCTL_STRUCT_CONV_TO(SPPPGETAUTHCFG, spppauthcfg);
diff -r b58b46450b23 -r d75befe36bab sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Sun May 31 22:16:16 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Sun May 31 22:19:41 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.50 2015/05/31 22:16:16 roy Exp $  */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.51 2015/05/31 22:19:41 roy Exp $  */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -426,6 +426,18 @@
 /* from <sys/sockio.h> */
 #define        SIOCGIFMEDIA32  _IOWR('i', 54, struct netbsd32_ifmediareq) /* get net media */
 
+/* from net/if_pppoe.h */
+struct netbsd32_pppoediscparms {
+       char    ifname[IFNAMSIZ];       /* pppoe interface name */
+       char    eth_ifname[IFNAMSIZ];   /* external ethernet interface name */
+       netbsd32_charp ac_name;         /* access concentrator name (or NULL) */
+       netbsd32_size_t ac_name_len;            /* on write: length of buffer for ac_name */
+       netbsd32_charp service_name;    /* service name (or NULL) */
+       netbsd32_size_t service_name_len;       /* on write: length of buffer for service name */
+};
+#define        PPPOESETPARMS32 _IOW('i', 110, struct netbsd32_pppoediscparms)
+#define        PPPOEGETPARMS32 _IOWR('i', 111, struct netbsd32_pppoediscparms)
+
 /* from net/if_sppp.h */
 struct netbsd32_spppauthcfg {
        char    ifname[IFNAMSIZ];       /* pppoe interface name */



Home | Main Index | Thread Index | Old Index