I'm looking to write kernel-space implementations of a non-IP network protocol and associated network device driver (non-ethernet hardware). I found some resources on developing the protocol and the driver, though I'm having difficulty understanding how to associate sockets using my protocol with my driver.
The aim is to have it working such that a program in userspace would only need to call
bind(socket(AF_TERRIBLE_IDEA, ...), ...); and be good to go.
The aim is to get more familiar developing for kernel-space simultaneously, so moving to userspace is not ideal.
when a bind call is made, how does the kernel know which device (and therefore device driver) to associate a socket to?