From c04383ba5f6c4cd2410903d3fc5c491c6c5a7d44 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Wed, 7 May 2008 08:00:51 +0000 Subject: add mpe_input() to be able to be fed packets that will reenter ip. no consumers yet, they should come soon. ok norby@ --- sys/net/if_mpe.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'sys/net/if_mpe.c') diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 28c05d5621f..e388d67e2b9 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -10,6 +10,7 @@ #include #include +#include #include #ifdef INET @@ -228,3 +229,34 @@ mpeioctl(struct ifnet *ifp, u_long cmd, caddr_t data) return (error); } + +void +mpe_input(struct mbuf *m) +{ + int s; + struct shim_hdr *shim; + + shim = mtod(m, struct shim_hdr *); + if (!(MPLS_BOS_ISSET(shim->shim_label))) { +#ifdef MPLS_DEBUG + printf("mpe_input: invalid packet with non BoS label\n"); +#endif + m_free(m); + } + + +#ifdef MPLS_DEBUG + printf("mpe_input: got packet with label: %d\n", + ((ntohl(shim->shim_label & MPLS_LABEL_MASK)) >> + MPLS_LABEL_OFFSET)); +#endif + m_adj(m, sizeof(shim)); + + s = splnet(); + /* + * assume we only get fed ipv4 packets for now. + */ + IF_ENQUEUE(&ipintrq, m); + schednetisr(NETISR_IP); + splx(s); +} -- cgit v1.2.3