>
>#define DEVICE_NAME "sda"
>
>       struct udd_entry foo;
>       struct udd_request bar;
>
>       foo.type = UDD_BLOCK_DEVICE;
>       foo.name = DEVICE_NAME;
>       foo.no_minors = 5;
>       /* etc... */
>
>       x = open("/dev/udd", O_RDWR);
>       if ((y = ioctl(x, UDD_INIT_DRIVER, &foo)) != 0) {
>               printf("Could not initialise driver.\n");
>               exit(1);
>       }
>
>       while ((y = ioctl(x, UDD_WAIT_REQUEST, &bar)) == 0) {
>               process_device_request(&bar);
>       }
>
>Device requests such as open, close, reads, writes, ioctls etc are
>all dealt with by calling the kernel with other ioctls which contain
>information about the call. If for example it recieved a read() request
>the reply would look something like this.
>
>process_read_request(struct udd_request * bar)
>{
>       char buffer[MAX_SIZE];
>       struct udd_request reply;
>       int bytes_read;
>
>       bytes-read = get_bytes(&buffer, bar->size);
>       reply.req_no = bar->req_no;
>       reply.data = &buffer;
>       reply.size = bytes-read;
>       
>       ioctl(x, UDD_REQUEST_COMPLETE, &reply);
>
>       return;
>}
>
>
>I can write the meta driver for this scheme, and a sample 
>driver which will
>probably be a loopback driver as this is the most simple to implement.
>
>Is anyone interested in this type of scheme?
>
this looks interesting

/dev/slip would be trivial

could we then have a /dev/ip that talked to either /dev/slip or /dev/ppp or
/dev/plip
then other layers /dev/icmp /dev/udp /dev/tcp as required

this is a change from the more common un*x sockets model, but might suit us

or am i going mad (again)

Cheers

Paul

PS. i might be tempted to do ip,icmp and udp this way.

Reply via email to