Probem with protosw
Ryan French
rfrench at freebsd.org
Fri Aug 8 12:49:16 UTC 2008
Hi,
I am working on my implementation of MPLS in FreeBSD and I'm having problems
with integrating the code I have ported over into the FreeBSD networking
stack. The problem I am having at the moment is trying to get my mpls
protocol struct to compile. When I try to build the kernel I get a pr_*
undeclared here (not in a function) error, for each field of the struct I
have declared. I have included the code just in case anyone is able to figure
this out.
Thanks,
Ryan French
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/socket.h>
#include <sys/domain.h>
#include <sys/protosw.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/route.h>
#include <net/netisr.h>
#include <netmpls/mpls.h>
/*
* MPLS protocol family:
*/
extern struct domain mplsdomain;
struct protosw mplssw[] = {
{
pr_type = 0,
pr_domain = &mplsdomain,
pr_init = mpls_init,
pr_sysctl = mpls_sysctl
},
{
pr_type = SOCK_DGRAM,
pr_domain = &mplsdomain,
pr_flags = PR_ATOMIC | PR_ADDR,
pr_usrreq = mpls_raw_usrreq,
pr_sysctl = mpls_sysctl
},
/* raw wildcard */
{
pr_type = SOCK_RAW,
pr_domain = &mplsdomain,
pr_flags = PR_ATOMIC | PR_ADDR,
pr_usrreq = mpls_raw_usrreq,
pr_sysctl = mpls_sysctl
},
};
struct domain mplsdomain = {
NETISR_MPLS, "mpls", mpls_init, 0, 0,
mplssw,
&mplssw[sizeof(mplssw)/sizeof(mplssw[0])], 0,
rn_inithead,
offsetof(struct sockaddr_mpls, smpls_in_ifindex) << 3,
sizeof(struct sockaddr_mpls)
};
More information about the freebsd-net
mailing list