Karel Kulhavy <[EMAIL PROTECTED]> writes: > How do I do this C call taken from a Linux program on OpenBSD? > > socket(PF_PACKET, SOCK_RAW, htons(0x4254)) > > man socket on OpenBSD offers AF_ISO (ISO protocols) which sounds like it > could be access to individual ISO stack layers including layer 2? However ...
When I wrote something using SOCK_RAW, some time back, I ended up digging through kernel sources and experimenting to figure out how it worked. There were some non-obvious features like setting the address family, using setsockopt(,IPPROTO_IP,IP_HDRINCL, and &etc. that were good to know. You might also want to check out tcpdump and libpcap - either the source for coding examples, or the tool or library for a higher level interface to generate packet traffic. AF_ISO is obselete - it got removed in openbsd some time ago. 4.4bsd had an arpa funded implementation of all of the iso networking standards, but somehow these just never did displace TCP/IP. For a dated but entertaining perspective on the ISO networking reference model vs. ietf, check out: RFC 871 A Perspective On The Arpanet Reference Model M.A. Padlipsky It's fashionable today to map TCP/IP layers into the iso networking reference model, but this is merely for "human" convenience, it's not something you'd code into a program. -Marcus Watts