2 #include "../port/lib.h"
6 #include "../port/error.h"
11 static void pktbind(Ipifc*, int, char**);
12 static void pktunbind(Ipifc*);
13 static void pktbwrite(Ipifc*, Block*, int, uchar*);
14 static void pktin(Fs*, Ipifc*, Block*);
30 * called to bind an IP ifc to an ethernet device
31 * called with ifc wlock'd
34 pktbind(Ipifc*, int argc, char **argv)
40 * called with ifc wlock'd
48 * called by ipoput with a single packet to write
51 pktbwrite(Ipifc *ifc, Block *bp, int, uchar*)
53 /* enqueue onto the conversation's rq */
55 if(ifc->conv->snoopers.ref > 0)
56 qpass(ifc->conv->sq, copyblock(bp, BLEN(bp)));
57 qpass(ifc->conv->rq, bp);
61 * called with ifc rlocked when someone write's to 'data'
64 pktin(Fs *f, Ipifc *ifc, Block *bp)
69 if(ifc->conv->snoopers.ref > 0)
70 qpass(ifc->conv->sq, copyblock(bp, BLEN(bp)));
78 addipmedium(&pktmedium);