Skip to content

Commit

Permalink
moved nemo specific ioctl macro to if_nemo.h
Browse files Browse the repository at this point in the history
  • Loading branch information
keiichi committed Feb 21, 2007
1 parent 11167f1 commit 16d28a2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 58 deletions.
3 changes: 0 additions & 3 deletions freebsd5/sys/sys/sockio.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@
#define SIOCGLIFPHYADDR _IOWR('i', 75, struct if_laddrreq) /* get gif addrs */
#define SIOCGSTFMODE _IOWR('i', 76, struct ifreq) /* get stf mode */
#define SIOCSSTFMODE _IOW('i', 77, struct ifreq) /* set stf mode */
#define SIOCSIFPHYNEXTHOP _IOW('i', 78, struct ifreq) /* set gif nexthop addres */
#define SIOCDIFPHYNEXTHOP _IOW('i', 79, struct ifreq) /* delete gif nexthop addres */
#define SIOCGIFPHYNEXTHOP _IOWR('i', 80, struct ifreq) /* get gif nexthop addr */

#define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */
#define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */
Expand Down
49 changes: 1 addition & 48 deletions kame/sys/net/if_gif.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: if_gif.c,v 1.116 2005/07/23 07:34:14 jinmei Exp $ */
/* $KAME: if_gif.c,v 1.117 2007/02/21 02:44:12 keiichi Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -908,54 +908,7 @@ gif_ioctl(ifp, cmd, data)
case SIOCSIFFLAGS:
/* if_ioctl() takes care of it */
break;
#ifdef MIP6
case SIOCSIFPHYNEXTHOP:
case SIOCSIFPHYNEXTHOP_IN6: {
struct sockaddr *nh = NULL;
int nhlen = 0;

switch (ifr->ifr_addr.sa_family) {
#ifdef INET
case AF_INET: /* IP supports Multicast */
error = EAFNOSUPPORT;
break;
#endif /* INET */
#ifdef INET6
case AF_INET6: /* IP6 supports Multicast */
nh = (struct sockaddr *)
&(((struct in6_ifreq *)data)->ifr_addr);
nhlen = sizeof(((struct in6_ifreq *)data)->ifr_addr);
break;
#endif /* INET6 */
default: /* Other protocols doesn't support Multicast */
error = EAFNOSUPPORT;
break;
}

if (error)
return error;

/* if pointer is null, allocate memory */
if (sc->gif_nexthop == NULL) {
sc->gif_nexthop = (struct sockaddr *)malloc(nhlen, M_IFADDR, M_WAITOK);
if (sc->gif_nexthop == NULL)
return ENOMEM;

bzero(sc->gif_nexthop, nhlen);
}
/* set request address into gif_nexthop */
bcopy(nh, sc->gif_nexthop, nhlen);
error = sa6_embedscope(satosin6(sc->gif_nexthop), 0);
if (error != 0)
return (error);
break;
}
case SIOCDIFPHYNEXTHOP:
/* if pointer is not null, free the memory */
if (sc->gif_nexthop)
free(sc->gif_nexthop, M_IFADDR);
break;
#endif
default:
error = EINVAL;
break;
Expand Down
6 changes: 5 additions & 1 deletion kame/sys/net/if_nemo.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: if_nemo.h,v 1.4 2006/12/12 10:27:04 mitsuya Exp $ */
/* $KAME: if_nemo.h,v 1.5 2007/02/21 02:44:13 keiichi Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -130,4 +130,8 @@ int nemo_encapcheck __P((const struct mbuf *, int, int, void *));

#endif /* !defined(__APPLE__) || (defined(__APPLE__) && defined(KERNEL_PRIVATE)) */

#define SIOCSIFPHYNEXTHOP _IOW('i', 78, struct ifreq) /* set nemo nxthop */
#define SIOCDIFPHYNEXTHOP _IOW('i', 79, struct ifreq) /* delete nemo nxthop */
#define SIOCGIFPHYNEXTHOP _IOWR('i', 80, struct ifreq) /* get nemo nxthop */

#endif /* _NET_IF_GIF_H_ */
3 changes: 0 additions & 3 deletions netbsd/sys/sys/sockio.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@
#define SIOCGLIFPHYADDR _IOWR('i', 75, struct if_laddrreq) /* get gif addrs */
#define SIOCGSTFMODE _IOWR('i', 76, struct ifreq) /* get stf mode */
#define SIOCSSTFMODE _IOW('i', 77, struct ifreq) /* set stf mode */
#define SIOCSIFPHYNEXTHOP _IOW('i', 78, struct ifreq) /* set gif addres */
#define SIOCDIFPHYNEXTHOP _IOW('i', 79, struct ifreq) /* delete gif addres */
#define SIOCGIFPHYNEXTHOP _IOW('i', 80, struct ifreq) /* get gif addres */

#define SIOCZIFDATA _IOWR('i', 129, struct ifdatareq) /* get if_data then
zero ctrs*/
Expand Down
3 changes: 0 additions & 3 deletions openbsd/sys/sys/sockio.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@
#define SIOCGLIFPHYADDR _IOWR('i', 75, struct if_laddrreq) /* get gif addrs */
#define SIOCGSTFMODE _IOWR('i', 76, struct ifreq) /* set stf mode */
#define SIOCSSTFMODE _IOW('i', 77, struct ifreq) /* get stf mode */
#define SIOCSIFPHYNEXTHOP _IOW('i', 78, struct ifreq) /* set gif addres */
#define SIOCDIFPHYNEXTHOP _IOW('i', 79, struct ifreq) /* delete gif addres */
#define SIOCGIFPHYNEXTHOP _IOW('i', 80, struct ifreq) /* get gif addres */

#define SIOCBRDGADD _IOW('i', 60, struct ifbreq) /* add bridge ifs */
#define SIOCBRDGGSIFS _IOWR('i', 60, struct ifbreq) /* get span ifs */
Expand Down

0 comments on commit 16d28a2

Please sign in to comment.