Encapsulation drivers

The next type of module you might want to write is an encapsulation driver. If you have stations that do TCP/IP, for example, in a non-standard encapsulation, you might want to write your own encap driver to do this.

Writing an encap driver is also pretty easy in the new ARCnet driver. rfc1051.c is only 265 lines. The RFC1201 encap driver, which used to be extremely complicated, is now slightly under 600 lines.

For most simple encapsulations, you should probably base your new driver on rfc1051.c, since it's the easiest to understand (except for arc-rawmode.c, but that one doesn't actually do anything).

Using the raw mode encap from userspace

Most of the time, you won't want to actually write your own encap driver; instead, you'll write a user-space program to read and write the packets yourself. For this, you load the arc-rawmode driver and use a raw packet socket, like you might do with raw ethernet packets.

Some sample code for sending and receiving raw packets is in the examples/ directory of the arcnet-3.90.tar.gz distribution.