|
@@ -21,46 +21,10 @@
|
21
|
21
|
static struct tcpip_net_protocol tcpip_net_protocols[0] __table_start ( tcpip_net_protocols );
|
22
|
22
|
static struct tcpip_net_protocol tcpip_net_protocols_end[0] __table_end ( tcpip_net_protocols );
|
23
|
23
|
|
24
|
|
-struct tcpip_protocol;
|
25
|
|
-
|
26
|
24
|
|
27
|
25
|
static struct tcpip_protocol tcpip_protocols[0] __table_start ( tcpip_protocols );
|
28
|
26
|
static struct tcpip_protocol tcpip_protocols_end[0] __table_end ( tcpip_protocols );
|
29
|
27
|
|
30
|
|
-
|
31
|
|
- *
|
32
|
|
- * @v sa_family Network address family
|
33
|
|
- * @ret tcpip Protocol supporting TCPIP, or NULL
|
34
|
|
- */
|
35
|
|
-static struct tcpip_net_protocol * tcpip_find_protocol ( sa_family_t sa_family ) {
|
36
|
|
- struct tcpip_net_protocol *tcpip_net;
|
37
|
|
-
|
38
|
|
- for ( tcpip_net = tcpip_net_protocols;
|
39
|
|
- tcpip_net < tcpip_net_protocols_end; ++tcpip_net ) {
|
40
|
|
- if ( tcpip_net->sa_family == sa_family ) {
|
41
|
|
- return tcpip_net;
|
42
|
|
- }
|
43
|
|
- }
|
44
|
|
- return NULL;
|
45
|
|
-}
|
46
|
|
-
|
47
|
|
-
|
48
|
|
- *
|
49
|
|
- * @v trans_proto Transport-layer protocol number, IP_XXX
|
50
|
|
- * @ret tcpip_protocol Transport-layer protocol, or NULL
|
51
|
|
- */
|
52
|
|
-struct tcpip_protocol* find_tcpip_protocol ( uint8_t trans_proto ) {
|
53
|
|
- struct tcpip_protocol *tcpip;
|
54
|
|
-
|
55
|
|
- for ( tcpip = tcpip_protocols; tcpip <= tcpip_protocols_end;
|
56
|
|
- ++tcpip ) {
|
57
|
|
- if ( tcpip->trans_proto == trans_proto ) {
|
58
|
|
- return tcpip;
|
59
|
|
- }
|
60
|
|
- }
|
61
|
|
- return NULL;
|
62
|
|
-}
|
63
|
|
-
|
64
|
28
|
|
65
|
29
|
*
|
66
|
30
|
* @v pkb Packet buffer
|