diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-06-26 15:54:54 +0000 |
commit | 7706f0a08b2425622121c23a7d2054794f2d677c (patch) | |
tree | d4b658006d8b0418b2afabe51bfae14c3f59bb97 /src/include/block_regex.h | |
parent | 133a5ecf306d35f9e86fb5a1f8b120783f6afdf9 (diff) | |
download | gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.tar.gz gnunet-7706f0a08b2425622121c23a7d2054794f2d677c.zip |
-removing unnecessary key from regex blocks, compacting some of the other fields
Diffstat (limited to 'src/include/block_regex.h')
-rw-r--r-- | src/include/block_regex.h | 98 |
1 files changed, 48 insertions, 50 deletions
diff --git a/src/include/block_regex.h b/src/include/block_regex.h index 282c626a2..73d7b70a5 100644 --- a/src/include/block_regex.h +++ b/src/include/block_regex.h | |||
@@ -39,77 +39,75 @@ extern "C" | |||
39 | #include <stdint.h> | 39 | #include <stdint.h> |
40 | 40 | ||
41 | 41 | ||
42 | GNUNET_NETWORK_STRUCT_BEGIN | ||
43 | |||
44 | |||
42 | /** | 45 | /** |
43 | * @brief A RegexBlock contains one or more of this struct in the payload. | 46 | * @brief A RegexBlock contains one or more of this struct in the payload. |
44 | */ | 47 | */ |
45 | struct RegexEdge | 48 | struct RegexEdge |
46 | { | 49 | { |
47 | /** | 50 | /** |
48 | * Destination of this edge. | 51 | * Destination of this edge. |
49 | */ | 52 | */ |
50 | struct GNUNET_HashCode key; | 53 | struct GNUNET_HashCode key; |
51 | 54 | ||
52 | /** | 55 | /** |
53 | * Length of the token towards the new state. | 56 | * Length of the token towards the new state. |
54 | */ | 57 | */ |
55 | unsigned int n_token; | 58 | uint32_t n_token GNUNET_PACKED; |
56 | 59 | ||
57 | /* char token[n_token] */ | 60 | /* char token[n_token] */ |
58 | }; | 61 | }; |
59 | 62 | ||
63 | |||
60 | /** | 64 | /** |
61 | * @brief Block to announce a regex state. | 65 | * @brief Block to announce a regex state. |
62 | */ | 66 | */ |
63 | struct RegexBlock | 67 | struct RegexBlock |
64 | { | 68 | { |
65 | /** | 69 | |
66 | * The key of the state. | 70 | /** |
67 | */ | 71 | * Length of the proof regex string. |
68 | struct GNUNET_HashCode key; | 72 | */ |
69 | 73 | uint16_t proof_len GNUNET_PACKED; | |
70 | /** | 74 | |
71 | * Length of the proof regex string. | 75 | /** |
72 | */ | 76 | * Is this state an accepting state? |
73 | unsigned int n_proof; | 77 | */ |
74 | 78 | int16_t is_accepting GNUNET_PACKED; | |
75 | /** | 79 | |
76 | * Numer of edges parting from this state. | 80 | /** |
77 | */ | 81 | * Numer of edges parting from this state. |
78 | unsigned int n_edges; | 82 | */ |
79 | 83 | uint32_t n_edges GNUNET_PACKED; | |
80 | /** | 84 | |
81 | * Is this state an accepting state? | 85 | /* char proof[n_proof] */ |
82 | */ | 86 | /* struct RegexEdge edges[n_edges] */ |
83 | int accepting; | ||
84 | |||
85 | /* char proof[n_proof] */ | ||
86 | /* struct RegexEdge edges[n_edges] */ | ||
87 | }; | 87 | }; |
88 | 88 | ||
89 | |||
89 | /** | 90 | /** |
90 | * @brief Block to announce a peer accepting a state. | 91 | * @brief Block to announce a peer accepting a state. |
91 | */ | 92 | */ |
92 | struct RegexAccept | 93 | struct RegexAccept |
93 | { | 94 | { |
94 | /** | 95 | /** |
95 | * The key of the state. | 96 | * The key of the state. |
96 | */ | 97 | */ |
97 | struct GNUNET_HashCode key; | 98 | struct GNUNET_HashCode key; |
98 | 99 | ||
99 | /** | 100 | /** |
100 | * Length of the proof regex string. | 101 | * The identity of the peer accepting the state |
101 | * FIXME necessary??? | 102 | */ |
102 | * already present in the leading MeshRegexBlock | 103 | struct GNUNET_PeerIdentity id; |
103 | */ | ||
104 | // unsigned int n_proof; | ||
105 | |||
106 | /** | ||
107 | * The identity of the peer accepting the state | ||
108 | */ | ||
109 | struct GNUNET_PeerIdentity id; | ||
110 | 104 | ||
111 | }; | 105 | }; |
112 | 106 | ||
107 | |||
108 | GNUNET_NETWORK_STRUCT_END | ||
109 | |||
110 | |||
113 | #if 0 /* keep Emacsens' auto-indent happy */ | 111 | #if 0 /* keep Emacsens' auto-indent happy */ |
114 | { | 112 | { |
115 | #endif | 113 | #endif |
@@ -117,4 +115,4 @@ struct RegexAccept | |||
117 | } | 115 | } |
118 | #endif | 116 | #endif |
119 | 117 | ||
120 | #endif \ No newline at end of file | 118 | #endif |