Re: linux PF_PACKET compatibility

On Fri, Feb 11, 2011 at 9:22 AM, Da Rock <
freebsd-hackers@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

"In recent versions of the Linux kernel (post-2.0 releases) a new protocol
family has been introduced, named PF_PACKET. This family allows an
application to send and receive packets dealing directly with the network
card driver, thus avoiding the usual protocol stack-handling (e.g., IP/TCP
or IP/UDP processing). That is, any packet sent through the socket will be
directly passed to the Ethernet interface, and any packet received through
the interface will be directly passed to the application."

I've been chasing the answer to a FreeBSD version of this (approx. anyway),
but I needed to find out what exactly PF_PACKET was first. Finally found
this answer here:

I looked up man socket and I can see possibilities (in my mind anyway), but
I thought I'd be best to check if the gurus here might have a better idea.
My reason for this is I'm attempting to build l2tpns (which supposedly
builds on 7.3?! with no trouble), and I'm chasing the errors which appear to
be linuxisms mostly.

So in man socket simply looking at the list of protocol families I'd say
network driver level would be similar to PF_LINK link layer interface? Is
there another man page I should be looking at as well?

FWIW my gmake output is this:

gcc -Wall -Wformat-security -Wno-format-zero-length -g -O3 -I.
-I/usr/include -I/usr/local/include -DLIBDIR='"/lib/l2tpns"'
-DBGP -c -o arp.o arp.c
arp.c: In function 'sendarp':
arp.c:34: error: storage size of 'sll' isn't known
arp.c:59: error: 'PF_PACKET' undeclared (first use in this function)
arp.c:59: error: (Each undeclared identifier is reported only once
arp.c:59: error: for each function it appears in.)
arp.c:62: error: 'AF_PACKET' undeclared (first use in this function)
arp.c:34: warning: unused variable 'sll'
gmake: *** [arp.o] Error 1

I posted this over at -questions@ but it was suggested to try here instead
(or -net@). I figured this would be the best place to start... :)

freebsd-hackers@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"

Take a look at bpf(4). I believe you could bypass the TCP/IP stack with
netgraph(4), as well, although with possibly more overhead.

Good, fast & cheap. Pick any two.
freebsd-hackers@xxxxxxxxxxx mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"

Relevant Pages

  • Re: VLANs and routing
    ... machine1 shouldn't have assigned IP address, ... to transmit a packet, it needs to put a source IP address into the packet ... - which virtually always comes from the interface. ... destination network should be collected by using ARP. ...
  • RE: Intrusion Prevention requirements document
    ... The tools consider one interface as "client" and other ... Packet 1 is first sent out on client interface. ... > The product uses two network cards and so the library of over 700 ... > my previous company was Blade Software where I developed IDS Informer ...
  • [TOOL] IPTraf, IP Network Monitoring Software
    ... IPTraf is a console-based network statistics utility for Linux. ... LAN station packet and byte counts. ... Includes TCP flag information, packet and byte counts, ... * General and detailed interface statistics showing IP, TCP, UDP, ICMP, ...
  • Intermittent loss of connectivity on QFE card
    ... I've got a Sun E450, running Solaris 7, with an hme card and a qfe ... The hme interface points to one private network (e.g. ... Using a packet sniffer, I see some more odd behavior. ...
  • Re: how to shape incoming traffic on specific port?
    ... >> What sort of set up is this? ... > various combinations for simulating another network. ... My assumption was that you would be recieving a packet on one ... interface and sending it to another interface. ...