Commit | Line | Data |
---|---|---|
b454c3ea | 1 | /* raw_usrreq.c 4.3 81/12/03 */ |
8df9431e BJ |
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; | |
8df9431e BJ |
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(); | |
8df9431e BJ |
49 | IF_DEQUEUE(&rawintrq, m); |
50 | splx(s); | |
51 | if (m == 0) | |
52 | return; | |
53 | /* ... */ | |
54 | goto drop; | |
55 | drop: | |
56 | m_freem(m); | |
57 | goto next; | |
58 | } | |
59 | ||
60 | /*ARGSUSED*/ | |
61 | raw_usrreq(so, req, m, addr) | |
62 | struct socket *so; | |
63 | int req; | |
64 | struct mbuf *m; | |
65 | caddr_t addr; | |
66 | { | |
67 | ||
68 | COUNT(RAW_USRREQ); | |
69 | ||
70 | } |