Rev 2878 | Rev 2883 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2878 | Rev 2880 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | 9 | ||
10 | #include <libadt/hash_table.h> |
10 | #include <libadt/hash_table.h> |
11 | 11 | ||
12 | typedef struct { |
12 | typedef struct { |
13 | char *name; |
13 | char *name; |
- | 14 | } oper_t; |
|
- | 15 | ||
- | 16 | typedef struct { |
|
- | 17 | /** Protocol name */ |
|
- | 18 | char *name; |
|
- | 19 | ||
- | 20 | /** Maps method number to operation */ |
|
- | 21 | hash_table_t method_oper; |
|
14 | } proto_t; |
22 | } proto_t; |
15 | 23 | ||
16 | /* Maps service number to protocol */ |
24 | /* Maps service number to protocol */ |
17 | extern hash_table_t srv_proto; |
25 | extern hash_table_t srv_proto; |
18 | 26 | ||
19 | void proto_init(void); |
27 | void proto_init(void); |
20 | void proto_cleanup(void); |
28 | void proto_cleanup(void); |
- | 29 | ||
21 | void proto_register(int srv, proto_t *proto); |
30 | void proto_register(int srv, proto_t *proto); |
22 | proto_t *proto_get_by_srv(int srv); |
31 | proto_t *proto_get_by_srv(int srv); |
23 | - | ||
- | 32 | proto_t *proto_new(char *name); |
|
- | 33 | void proto_add_oper(proto_t *proto, int method, oper_t *oper); |
|
- | 34 | oper_t *proto_get_oper(proto_t *proto, int method); |
|
24 | 35 | ||
25 | #endif |
36 | #endif |
26 | 37 | ||
27 | /** @} |
38 | /** @} |
28 | */ |
39 | */ |