1 /* raw_usrreq.c 4.1 81/11/29 */ 2 3 #include "../h/param.h" 4 #include "../h/mbuf.h" 5 #include "../h/socket.h" 6 #include "../h/socketvar.h" 7 #include "../h/mtpr.h" 8 #include "../net/in.h" 9 #include "../net/in_systm.h" 10 #include "../net/if.h" 11 12 /* 13 * Raw protocol interface. 14 */ 15 raw_input(m, pf, af) 16 struct mbuf *m; 17 struct sockproto pf; 18 struct sockaddr af; 19 { 20 struct mbuf *mh; 21 struct sockproto *pfp; 22 int s; 23 24 mh = m_get(0); 25 if (mh == 0) 26 goto drop; 27 mh->m_next = m; 28 mh->m_off = MMINOFF + sizeof (struct sockproto); 29 *mtod(m, struct sockaddr *) = af; 30 mh->m_off = MMINOFF; 31 *mtod(m, struct sockproto *) = pf; 32 mh->m_len = sizeof (struct sockproto) + sizeof (struct sockaddr); 33 s = splimp(); 34 IF_ENQUEUE(&rawintrq, mh); 35 splx(s); 36 setrawintr(); 37 return; 38 drop: 39 m_freem(m); 40 } 41 42 rawintr() 43 { 44 int s; 45 struct mbuf *m; 46 47 COUNT(RAWINTR); 48 next: 49 s = splimp(); 50 /*###45 [cc] rawintrq undefined %%%*/ 51 IF_DEQUEUE(&rawintrq, m); 52 splx(s); 53 if (m == 0) 54 return; 55 /* ... */ 56 goto drop; 57 drop: 58 m_freem(m); 59 goto next; 60 } 61 62 /*ARGSUSED*/ 63 raw_usrreq(so, req, m, addr) 64 struct socket *so; 65 int req; 66 struct mbuf *m; 67 caddr_t addr; 68 { 69 70 COUNT(RAW_USRREQ); 71 72 } 73