Re: Initialisation of a networking protocol

2008-09-29 Thread Ryan French
Hi,

Thanks for the help. I managed to figure out that the problem was I had left
out the DOMAIN_SET command in my code, but I've got that sorted now and am
just working through bugs in my code causing page faults whenever an MPLS
packet is received. Should hopefully have something up and running by the
weeks end.

Thanks again,
Ryan French.
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Initialisation of a networking protocol

2008-09-29 Thread Bruce M. Simpson

Hi Ryan,

Did you initialize the .pr_init member of struct protosw for MPLS?

AFAIK, MPLS does not use an outer IP header, so adding a struct 
ipprotosw won't work; they are similar structs however.


cheers
BMS
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Initialisation of a networking protocol

2008-09-29 Thread Robert Watson


On Mon, 29 Sep 2008, Ryan French wrote:

I'm having a bit of trouble with my MPLS protocol code at the moment. I have 
the code written and compiling (mostly based on some OpenBSD code I was 
shown) but when an MPLS packet is received it doesnt appear as thou my 
mpls_input routine is being called. I believe this is because I have not 
initialised the protocol properly. I have created protosw structure for MPLS 
as well as created an mpls_init(void) function which registers the protocol 
with netisr via netisr_register. Other than that I am not really sure where 
I tell the kernel to call the mpls_init function so that the protocol is 
initialised, and a couple of hours of googling/looking through ip6 code 
hasnt really helped at all. If anyone can help and needs to see the code it 
can be viewed on Perforce at 
http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/soc2008/rfrench_mpls&HIDEDEL=NO


Hi Ryan:

netisr is just a dispatch facility consisting of a series of named queues, 
worker thread(s), and a dispatch model -- it is the responsibility of some 
other piece of driver or protocol code to inject packets using netisr_queue() 
or netisr_dispatch().  Typically this occurs in the decapsulation code for the 
layer below the dispatched layer -- often the link layer.  You can take a look 
at current dispatch points here:


  http://fxr.watson.org/fxr/ident?im=bigexcerpts;i=netisr_queue
  http://fxr.watson.org/fxr/ident?im=bigexcerpts;i=netisr_dispatch

A typical dispatch point is ether_demux(), which switches on the etherhet 
frame header's protocol field and then hands off the packet to netisr for 
dispatch.  If the dispatch may lead to recursion, then you may need to use 
netisr_queue() rather than netisr_direct() to disallow direct dispatch.


Robert N M Watson
Computer Laboratory
University of Cambridge
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Initialisation of a networking protocol

2008-09-28 Thread Ryan French
Hi everyone,

I'm having a bit of trouble with my MPLS protocol code at the moment. I have
the code written and compiling (mostly based on some OpenBSD code I was
shown) but when an MPLS packet is received it doesnt appear as thou my
mpls_input routine is being called. I believe this is because I have not
initialised the protocol properly. I have created protosw structure for MPLS
as well as created an mpls_init(void) function which registers the protocol
with netisr via netisr_register. Other than that I am not really sure where I
tell the kernel to call the mpls_init function so that the protocol is
initialised, and a couple of hours of googling/looking through ip6 code hasnt
really helped at all. If anyone can help and needs to see the code it can be
viewed on Perforce at
http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/soc2008/rfrench_mpls&HIDEDEL=NO

Thanks for any help.
- Ryan French
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"