Date: Mon, 18 Aug 2008 21:19:33 GMT From: Ryan French <rfrench@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 147776 for review Message-ID: <200808182119.m7ILJXWb043041@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147776 Change 147776 by rfrench@rfrench_mpls on 2008/08/18 21:19:25 Last submission for Google Summer of Code. Unfortunately not working yet, but I feel it is very close. I will continue to work on this until it is working, at least to some standard. Affected files ... .. //depot/projects/soc2008/rfrench_mpls/net/if_ethersubr.c#5 edit .. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls.h#4 edit .. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#4 edit .. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_proto.c#4 edit .. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_raw.c#4 edit Differences ... ==== //depot/projects/soc2008/rfrench_mpls/net/if_ethersubr.c#5 (text+ko) ==== @@ -807,36 +807,36 @@ isr = NETISR_AARP; break; #endif /* NETATALK */ -#ifdef MPLS - case AF_MPLS: - printf("mpls packet received\n"); - if (rt) - dst = rt_key(rt); - else - senderr(EHOSTUNREACH); - - switch (dst->sa_family) { - case AF_LINK: - if (((struct sockaddr_dl *) dst)->sdl_alen < - sizeof(edst)) - senderr(EHOSTUNREACH); - bcopy(LLADDR(((struct sockaddr_dl *)dst)), edst, - sizeof(edst)); - break; - case AF_INET: - if (!arpresolve(ac, rt, m, dst, edst)) - return (0); /* if not yet resolved */ - break; - default: - senderr(EHOSTUNREACH); - } +//#ifdef MPLS + case ETHERTYPE_MPLS: + printf("MPLS packet received\n"); +// if (rt) +// dst = rt_key(rt); +// else +// senderr(EHOSTUNREACH); +// +// switch (dst->sa_family) { +// case AF_LINK: +// if (((struct sockaddr_dl *) dst)->sdl_alen < +// sizeof(edst)) +// senderr(EHOSTUNREACH); +// bcopy(LLADDR(((struct sockaddr_dl *)dst)), edst, +// sizeof(edst)); +// break; +// case AF_INET: +// if (!arpresolve(ac, rt, m, dst, edst)) +// return (0); /* if not yet resolved */ +// break; +// default: +// senderr(EHOSTUNREACH); +// } /* XXX handling for simplex devices in case of M/BCAST ?? */ if (m->m_flags && (M_BCAST | M_MCAST)) isr = NETISR_MPLS_MCAST; else isr = NETISR_MPLS; break; -#endif /* MPLS */ +//#endif /* MPLS */ default: #ifdef IPX if (ef_inputp && ef_inputp(ifp, eh, m) == 0) ==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls.h#4 (text+ko) ==== @@ -40,6 +40,9 @@ #include <net/if.h> #include <net/if_dl.h> +#define MPLS +#define MPLS_DEBUG + /* * Structure of a SHIM header. */ ==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#4 (text+ko) ==== ==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_proto.c#4 (text+ko) ==== @@ -48,6 +48,9 @@ * MPLS protocol family: */ +#define MPLS +#define MPLS_DEBUG + extern struct domain mplsdomain; extern struct pr_usrreqs mpls_raw_usrreq; @@ -55,23 +58,20 @@ { .pr_type = 0, .pr_domain = &mplsdomain, - .pr_init = mpls_init/*, - .pr_sysctl = mpls_sysctl*/ + .pr_init = mpls_init, }, { .pr_type = SOCK_DGRAM, .pr_domain = &mplsdomain, .pr_flags = PR_ATOMIC | PR_ADDR, - .pr_usrreqs = &mpls_raw_usrreq/*, - .pr_sysctl = mpls_sysctl*/ + .pr_usrreqs = &mpls_raw_usrreq, }, /* raw wildcard */ { .pr_type = SOCK_RAW, .pr_domain = &mplsdomain, .pr_flags = PR_ATOMIC | PR_ADDR, - .pr_usrreqs = &mpls_raw_usrreq/*, - .pr_sysctl = mpls_sysctl*/ + .pr_usrreqs = &mpls_raw_usrreq, }, }; ==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_raw.c#4 (text+ko) ==== @@ -52,9 +52,18 @@ u_long mpls_raw_sendspace = MPLS_RAW_SNDQ; u_long mpls_raw_recvspace = MPLS_RAW_RCVQ; -int mpls_enable = 0; +int mpls_enable = 1; +// SYSCTL_INT( _net_mpls, MPLSCTL_ENABLE, enable, CTLFLAG_RW, +// &mpls_enable, 0, "Enable the MPLS protocol"); + int mpls_defttl = 255; +// SYSCTL_INT( _net_mpls, MPLSCTL_DEFTTL, ttl, CTLFLAG_RW, +// &mpls_defttl, 0, "Maximum TTL on MPLS packets"); + int mpls_inkloop = 16; +// SYSCTL_INT( _net_mpls, MPLSCTL_MAXINKLOOP, inkloop, CTLFLAG_RW, +// &mpls_inkloop, 0, "Set MPLS Max Ink Loop"); + int mpls_push_expnull_ip = 0; int mpls_push_expnull_ip6 = 0; int mpls_mapttl_ip = 1; @@ -63,7 +72,7 @@ int *mplsctl_vars[MPLSCTL_MAXID] = MPLSCTL_VARS; int mpls_control(struct socket *, u_long, caddr_t, struct ifnet *, struct thread *); -static int mpls_attach(struct socket *); +static int mpls_attach(struct socket *, int, struct thread *); /* * Generic MPLS control operations (ioctl's). @@ -77,7 +86,7 @@ } static int -mpls_attach(struct socket *so) +mpls_attach(struct socket *so, int proto, struct thread *td) { int error = 0; if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808182119.m7ILJXWb043041>