1 /* raw_usrreq.c 4.2 81/12/02 */ 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 int s; 22 23 mh = m_get(0); 24 if (mh == 0) 25 goto drop; 26 mh->m_next = m; 27 mh->m_off = MMINOFF + sizeof (struct sockproto); 28 *mtod(m, struct sockaddr *) = af; 29 mh->m_off = MMINOFF; 30 *mtod(m, struct sockproto *) = pf; 31 mh->m_len = sizeof (struct sockproto) + sizeof (struct sockaddr); 32 s = splimp(); 33 IF_ENQUEUE(&rawintrq, mh); 34 splx(s); 35 setrawintr(); 36 return; 37 drop: 38 m_freem(m); 39 } 40 41 rawintr() 42 { 43 int s; 44 struct mbuf *m; 45 46 COUNT(RAWINTR); 47 next: 48 s = splimp(); 49 /*###45 [cc] rawintrq undefined %%%*/ 50 IF_DEQUEUE(&rawintrq, m); 51 splx(s); 52 if (m == 0) 53 return; 54 /* ... */ 55 goto drop; 56 drop: 57 m_freem(m); 58 goto next; 59 } 60 61 /*ARGSUSED*/ 62 raw_usrreq(so, req, m, addr) 63 struct socket *so; 64 int req; 65 struct mbuf *m; 66 caddr_t addr; 67 { 68 69 COUNT(RAW_USRREQ); 70 71 } 72