vether.c (1093B)
1 #include "u.h" 2 #include "mem.h" 3 #include "lib.h" 4 #include "dat.h" 5 #include "fns.h" 6 #include "error.h" 7 #include "ip/ip.h" 8 #include "netif.h" 9 #include "etherif.h" 10 #include "vether.h" 11 #include "sd.h" 12 13 extern int nettap; 14 extern void ethertaplink(void); 15 extern void etherpcaplink(void); 16 extern void ethermediumlink(void); 17 extern void loopbackmediumlink(void); 18 extern void netdevmediumlink(void); 19 20 extern void ilinit(Fs*); 21 extern void tcpinit(Fs*); 22 extern void udpinit(Fs*); 23 extern void ipifcinit(Fs*); 24 extern void icmpinit(Fs*); 25 extern void icmp6init(Fs*); 26 extern void greinit(Fs*); 27 extern void ipmuxinit(Fs*); 28 extern void espinit(Fs*); 29 30 extern SDifc sdloopifc; 31 extern SDifc sdaoeifc; 32 33 void links(void) { 34 ethermediumlink(); 35 loopbackmediumlink(); 36 netdevmediumlink(); 37 for(int i=0; i<MaxEther; i++){ 38 if(ve[i].dev == nil) 39 continue; 40 if(ve[i].tap == 1) 41 ethertaplink(); 42 else 43 etherpcaplink(); 44 } 45 } 46 47 void (*ipprotoinit[])(Fs*) = { 48 ilinit, 49 tcpinit, 50 udpinit, 51 ipifcinit, 52 icmpinit, 53 icmp6init, 54 greinit, 55 ipmuxinit, 56 espinit, 57 nil, 58 }; 59 60 SDifc *sdifc[] = 61 { 62 &sdloopifc, 63 &sdaoeifc, 64 0, 65 };