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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: A problem about using PF_PACKET.

  1. 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!!!

  2. 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.

  3. 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!!!

+ Reply to Thread