A problem about using PF_PACKET. - Linux
This is a discussion on A problem about using PF_PACKET. - Linux ; I wanna implement a protocol in usermode using pf_packet,
this protocol is like this:
----------
Application
---------
ME protocol
---------
socket
--------
ETH_P_ME
--------
LLC
--------
802.11
--------
I can send to the network now. My problem is how to ...
-
A problem about using PF_PACKET.
I wanna implement a protocol in usermode using pf_packet,
this protocol is like this:
----------
Application
---------
ME protocol
---------
socket
--------
ETH_P_ME
--------
LLC
--------
802.11
--------
I can send to the network now. My problem is how to receive a packet
of type: ETH_P_ME?
It seems that i should call dev_add_pack and provide a recv function
like ip_rcv, but how to route this packet to the socket in the user
space??
Thanks a lot!!!
-
Re: A problem about using PF_PACKET.
lander writes:
> I wanna implement a protocol in usermode using pf_packet,
>
> this protocol is like this:
> ----------
> Application
> ---------
> ME protocol
> ---------
> socket
> --------
> ETH_P_ME
> --------
> LLC
> --------
> 802.11
> --------
>
> I can send to the network now. My problem is how to receive a packet
> of type: ETH_P_ME?
>
> It seems that i should call dev_add_pack and provide a recv function
> like ip_rcv, but how to route this packet to the socket in the user
> space??
Use a PF_PACKET RAW socket bound to ETH_P_ME. The kernel will then
'route them to the socket' for you.
-
Re: A problem about using PF_PACKET.
On 6月13日, 下午9时19分, Rainer Weikusat wrote:
> lander writes:
> > I wanna implement a protocol in usermode using pf_packet,
>
> > this protocol is like this:
> > ----------
> > Application
> > ---------
> > ME protocol
> > ---------
> > socket
> > --------
> > ETH_P_ME
> > --------
> > LLC
> > --------
> > 802.11
> > --------
>
> > I can send to the network now. My problem is how to receive a packet
> > of type: ETH_P_ME?
>
> > It seems that i should call dev_add_pack and provide a recv function
> > like ip_rcv, but how to route this packet to the socket in the user
> > space??
>
> Use a PF_PACKET RAW socket bound to ETH_P_ME. The kernel will then
> 'route them to the socket' for you.- 隐藏被引用文字 -
>
> - 显示引用的文字 -
Thanks a lot!!!