| plan 9 kernel history: overview | file list | diff list |
1998/0313/ip/pktmedium.c (diff list | history)
| ip/pktmedium.c on 1998/0306 | ||
| 1998/0306 | #include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" #include "fns.h" #include "../port/error.h" #include "ip.h" #include "kernel.h" static void pktbind(Ipifc *ifc, int argc, char **argv); static void pktunbind(Ipifc *ifc); static void pktbwrite(Ipifc *ifc, Block *bp, int version, uchar *ip); | |
| 1998/0313 | static void pktin(Fs*, Ipifc *ifc, Block *bp); | |
| 1998/0306 | Medium pktmedium = { "pkt", 14, 60, 1514, 6, pktbind, pktunbind, pktbwrite, nil, /* addmulti */ nil, /* remmulti */ pktin, nil, /* addroute */ nil, /* remroute */ nil, /* flushroute */ nil, /* joinmulti */ nil, /* leave multi */ | |
| 1998/0307 | 1, /* unbind on last close */ | |
| 1998/0306 | }; /* * called to bind an IP ifc to an ethernet device * called with ifc wlock'd */ static void pktbind(Ipifc*, int, char**) { } /* * called with ifc wlock'd */ static void pktunbind(Ipifc*) { } /* * called by ipoput with a single packet to write */ static void pktbwrite(Ipifc *ifc, Block *bp, int, uchar*) { /* enqueue onto the conversation's rq */ bp = concatblock(bp); qpass(ifc->conv->rq, bp); } /* | |
| 1998/0313 | * called with ifc rlocked when someone write's to 'data' | |
| 1998/0306 | */ static void | |
| 1998/0313 | pktin(Fs *f, Ipifc *ifc, Block *bp) | |
| 1998/0306 | { if(ifc->lifc == nil) freeb(bp); else | |
| 1998/0313 | ipiput(f, ifc->lifc->local, bp); | |
| 1998/0306 | } | |