tor  0.4.2.0-alpha-dev
dispatch_naming.h
1 /* Copyright (c) 2001, Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2018, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 #ifndef TOR_DISPATCH_NAMING_H
8 #define TOR_DISPATCH_NAMING_H
9 
10 #include "lib/dispatch/msgtypes.h"
11 #include <stddef.h>
12 
18 channel_id_t get_channel_id(const char *);
22 const char *get_channel_id_name(channel_id_t);
26 size_t get_num_channel_ids(void);
27 
28 /* As above, but for messages. */
29 message_id_t get_message_id(const char *);
30 const char *get_message_id_name(message_id_t);
31 size_t get_num_message_ids(void);
32 
33 /* As above, but for subsystems */
34 subsys_id_t get_subsys_id(const char *);
35 const char *get_subsys_id_name(subsys_id_t);
36 size_t get_num_subsys_ids(void);
37 
38 /* As above, but for types. Note that types additionally must be
39  * "defined", if any message is to use them. */
40 msg_type_id_t get_msg_type_id(const char *);
41 const char *get_msg_type_id_name(msg_type_id_t);
42 size_t get_num_msg_type_ids(void);
43 
44 void dispatch_naming_init(void);
45 
46 #endif /* !defined(TOR_DISPATCH_NAMING_H) */
Types used for messages in the dispatcher code.
uint16_t msg_type_id_t
Definition: msgtypes.h:29
uint16_t subsys_id_t
Definition: msgtypes.h:22