nullmedium.c (501B)
1 #include "u.h" 2 #include "lib.h" 3 #include "mem.h" 4 #include "dat.h" 5 #include "fns.h" 6 #include "error.h" 7 8 #include "ip.h" 9 10 static void 11 nullbind(Ipifc* _, int __, char** ___) 12 { 13 error("cannot bind null device"); 14 } 15 16 static void 17 nullunbind(Ipifc* _) 18 { 19 } 20 21 static void 22 nullbwrite(Ipifc* _, Block* __, int ___, uchar* ____) 23 { 24 error("nullbwrite"); 25 } 26 27 Medium nullmedium = 28 { 29 .name= "null", 30 .bind= nullbind, 31 .unbind= nullunbind, 32 .bwrite= nullbwrite, 33 }; 34 35 void 36 nullmediumlink(void) 37 { 38 addipmedium(&nullmedium); 39 }