FreeBSD kernel module and sending udp packets

Ferner Cilloniz fernercc at gmail.com
Mon Dec 8 14:21:48 PST 2008


Yes I am writing my own loadable kernel module such that I can send a
UDP packet when i tell it to by issuing a homemade system call.

I have been looking at /usr/src/sys/netgraph/ng_sample.c

Am i supposed to implement the functions in that file? I am a little
lost. I only want to send a UDP packet and in that file I see functions
concerning receiving.

Is there any other way?

Thanks Julian and everyone else.

On Mon, 2008-12-08 at 11:03 -0800, Julian Elischer wrote:
> Ferner Cilloniz wrote:
> > Hi Julian. I'm very happy for your help. I have read the guide to
> > netgraph and find it very interesting :)
> > 
> > I still dont understand when you say "you could give your module a
> > netgraph interface."
> > 
> > Can you please explain this a little more please?
> 
> 
> You indicated that you were going to be writing your own module.
> your module should include the interface functions indicated in 
> ng_sample.c
> 
> That will allow your module to be hooked up to the other netgraph 
> modules in whatever orrder you want, and that includes the ng_ksocket
> module that would allow your module to sned and receive data through
> the in-kernel socket.
> 
> 
> > 
> > Thanks.
> > 
> > On Mon, 2008-12-08 at 00:23 -0800, Julian Elischer wrote:
> >> Ferner Cilloniz wrote:
> >>> Thanks for the reply. I read something about that but I didn't
> >>> understand what was being said.
> >>>
> >>> Can you please help me in understanding. I have googled for sample code
> >>> and didn't find anything useful. Can you, or anyone else, please help me
> >>> understand this?
> >> http://people.freebsd.org/~julian/netgraph.html
> >>
> >>> Thanks again :)
> >>>
> >>> On Mon, 2008-12-08 at 00:07 -0800, Julian Elischer wrote:
> >>>> Ferner Cilloniz wrote:
> >>>>> Hello everyone.
> >>>>>
> >>>>> I need help with documentation concerning how to send a udp or tcp
> >>>>> packet from a kernel module. I have found this information for Linux but
> >>>>> not for FreeBSD.
> >>>>>
> >>>>> Please help me.
> >>>> you could give your module a netgraph interface. Then it can connect 
> >>>> directly to the ng_ksocket node type and use that. as an in-kernel socket.
> >>>>
> >>>>
> >>>>
> >>>>> Thank you :)
> >>>>>
> >>>>> _______________________________________________
> >>>>> freebsd-net at freebsd.org mailing list
> >>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> >>>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
> 
-- 
Cilloniz Bicchi, Ferner

Research Assistant
Dept. of Computer Sciences
The University of Texas at Austin
http://www.cs.utexas.edu/~fernercc
fernercc at cs.utexas.edu



More information about the freebsd-net mailing list