Add hook for IPv6.

This commit is contained in:
Archie Cobbs 2000-05-10 16:54:00 +00:00
parent b51a864598
commit b715c697bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60330
2 changed files with 9 additions and 4 deletions

View File

@ -40,10 +40,6 @@
* $Whistle: ng_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp $
*/
#include "opt_inet.h"
#include "opt_atalk.h"
#include "opt_ipx.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
@ -112,6 +108,7 @@ struct cisco_priv {
struct protoent inet; /* IP information */
struct in_addr localip;
struct in_addr localmask;
struct protoent inet6; /* IPv6 information */
struct protoent atalk; /* AppleTalk information */
struct protoent ipx; /* IPX information */
};
@ -215,6 +212,7 @@ cisco_constructor(node_p *nodep)
/* Initialise the varous protocol hook holders */
sc->downstream.af = 0xffff;
sc->inet.af = AF_INET;
sc->inet6.af = AF_INET6;
sc->atalk.af = AF_APPLETALK;
sc->ipx.af = AF_IPX;
return (0);
@ -383,6 +381,9 @@ cisco_rcvdata(hook_p hook, struct mbuf *m, meta_p meta,
case AF_INET: /* Internet Protocol */
h->protocol = htons(ETHERTYPE_IP);
break;
case AF_INET6:
h->protocol = htons(ETHERTYPE_IPV6);
break;
case AF_APPLETALK: /* AppleTalk Protocol */
h->protocol = htons(ETHERTYPE_AT);
break;
@ -520,6 +521,9 @@ cisco_input(sc_p sc, struct mbuf *m, meta_p meta)
case ETHERTYPE_IP:
pep = &sc->inet;
break;
case ETHERTYPE_IPV6:
pep = &sc->inet6;
break;
case ETHERTYPE_AT:
pep = &sc->atalk;
break;

View File

@ -50,6 +50,7 @@
/* Hook names */
#define NG_CISCO_HOOK_DOWNSTREAM "downstream"
#define NG_CISCO_HOOK_INET "inet"
#define NG_CISCO_HOOK_INET6 "inet6"
#define NG_CISCO_HOOK_APPLETALK "atalk"
#define NG_CISCO_HOOK_IPX "ipx"
#define NG_CISCO_HOOK_DEBUG "debug"