tor  0.4.2.1-alpha-dev
msgtypes.h
Go to the documentation of this file.
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 
12 #ifndef TOR_DISPATCH_MSGTYPES_H
13 #define TOR_DISPATCH_MSGTYPES_H
14 
15 #include <stdint.h>
16 
17 #include "ext/tor_queue.h"
18 
22 typedef uint16_t subsys_id_t;
23 typedef uint16_t channel_id_t;
24 typedef uint16_t message_id_t;
25 
29 typedef uint16_t msg_type_id_t;
30 
34 #define ERROR_ID 65535
35 
42 typedef union {
43  void *ptr;
44  uint64_t u64;
46 
50 typedef struct msg_t {
51  TOR_SIMPLEQ_ENTRY(msg_t) next;
52  subsys_id_t sender;
53  channel_id_t channel;
54  message_id_t msg;
61 } msg_t;
62 
66 typedef void (*recv_fn_t)(const msg_t *m);
67 
72 typedef struct dispatch_typefns_t {
77  char *(*fmt_fn)(msg_aux_data_t);
79 
80 #endif /* !defined(TOR_DISPATCH_MSGTYPES_H) */
msg_type_id_t type
Definition: msgtypes.h:57
void(* free_fn)(msg_aux_data_t)
Definition: msgtypes.h:74
Definition: msgtypes.h:50
struct msg_t msg_t
uint16_t msg_type_id_t
Definition: msgtypes.h:29
uint16_t subsys_id_t
Definition: msgtypes.h:22
void(* recv_fn_t)(const msg_t *m)
Definition: msgtypes.h:66
msg_aux_data_t aux_data__
Definition: msgtypes.h:60
struct dispatch_typefns_t dispatch_typefns_t