diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-04 21:05:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-04 21:05:33 +0000 |
commit | 7a60a53dc6196477508fcdd1aef7994a2151814f (patch) | |
tree | f5c10dffa5290dac59d1d3e86f2e2e7093a067ad /src/transport/gnunet-service-transport_clients.h | |
parent | 8ee9da8977211e202dda36db87959b1426a3ce1d (diff) | |
download | gnunet-7a60a53dc6196477508fcdd1aef7994a2151814f.tar.gz gnunet-7a60a53dc6196477508fcdd1aef7994a2151814f.zip |
improved client API
Diffstat (limited to 'src/transport/gnunet-service-transport_clients.h')
-rw-r--r-- | src/transport/gnunet-service-transport_clients.h | 99 |
1 files changed, 98 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport_clients.h b/src/transport/gnunet-service-transport_clients.h index aa696b1ab..3bd9c008c 100644 --- a/src/transport/gnunet-service-transport_clients.h +++ b/src/transport/gnunet-service-transport_clients.h | |||
@@ -47,12 +47,109 @@ GST_clients_stop (void); | |||
47 | 47 | ||
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Initialize a normal client. We got an init message from this | ||
51 | * client, add him to the list of clients for broadcasting of inbound | ||
52 | * messages. | ||
53 | * | ||
54 | * @param cls unused | ||
55 | * @param client the client | ||
56 | * @param message the init message that was sent | ||
57 | */ | ||
58 | void | ||
59 | GST_clients_handle_init (void *cls, | ||
60 | struct GNUNET_SERVER_Client *client, | ||
61 | const struct GNUNET_MessageHeader *message); | ||
62 | |||
63 | |||
64 | /** | ||
65 | * Client asked for transmission to a peer. Process the request. | ||
66 | * | ||
67 | * @param cls unused | ||
68 | * @param client the client | ||
69 | * @param message the send message that was sent | ||
70 | */ | ||
71 | void | ||
72 | GST_clients_handle_send (void *cls, | ||
73 | struct GNUNET_SERVER_Client *client, | ||
74 | const struct GNUNET_MessageHeader *message); | ||
75 | |||
76 | |||
77 | /** | ||
78 | * Client asked for a quota change for a particular peer. Process the request. | ||
79 | * | ||
80 | * @param cls unused | ||
81 | * @param client the client | ||
82 | * @param message the quota changing message | ||
83 | */ | ||
84 | void | ||
85 | GST_clients_handle_set_quota (void *cls, | ||
86 | struct GNUNET_SERVER_Client *client, | ||
87 | const struct GNUNET_MessageHeader *message); | ||
88 | |||
89 | |||
90 | /** | ||
91 | * Client asked to resolve an address. Process the request. | ||
92 | * | ||
93 | * @param cls unused | ||
94 | * @param client the client | ||
95 | * @param message the resolution request | ||
96 | */ | ||
97 | void | ||
98 | GST_clients_handle_address_lookup (void *cls, | ||
99 | struct GNUNET_SERVER_Client *client, | ||
100 | const struct GNUNET_MessageHeader *message); | ||
101 | |||
102 | |||
103 | /** | ||
104 | * Client asked to obtain information about a peer's addresses. | ||
105 | * Process the request. | ||
106 | * | ||
107 | * @param cls unused | ||
108 | * @param client the client | ||
109 | * @param message the peer address information request | ||
110 | */ | ||
111 | void | ||
112 | GST_clients_handle_peer_address_lookup (void *cls, | ||
113 | struct GNUNET_SERVER_Client *client, | ||
114 | const struct GNUNET_MessageHeader *message); | ||
115 | |||
116 | |||
117 | /** | ||
118 | * Client asked to obtain information about all addresses. | ||
119 | * Process the request. | ||
120 | * | ||
121 | * @param cls unused | ||
122 | * @param client the client | ||
123 | * @param message the peer address information request | ||
124 | */ | ||
125 | void | ||
126 | GST_clients_handle_address_iterate (void *cls, | ||
127 | struct GNUNET_SERVER_Client *client, | ||
128 | const struct GNUNET_MessageHeader *message); | ||
129 | |||
130 | |||
131 | /** | ||
50 | * Broadcast the given message to all of our clients. | 132 | * Broadcast the given message to all of our clients. |
51 | * | 133 | * |
52 | * @param msg message to broadcast | 134 | * @param msg message to broadcast |
135 | * @param candrop GNUNET_YES if the message can be dropped | ||
136 | */ | ||
137 | void | ||
138 | GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, | ||
139 | int candrop); | ||
140 | |||
141 | |||
142 | /** | ||
143 | * Send the given message to a particular client | ||
144 | * | ||
145 | * @param client target of the message | ||
146 | * @param msg message to transmit | ||
147 | * @param candrop GNUNET_YES if the message can be dropped | ||
53 | */ | 148 | */ |
54 | void | 149 | void |
55 | GST_clients_broadcast (const struct GNUNET_MessageHeader *msg); | 150 | GST_clients_unicast (struct GNUNET_SERVER_Client *client, |
151 | const struct GNUNET_MessageHeader *msg, | ||
152 | int candrop); | ||
56 | 153 | ||
57 | 154 | ||
58 | 155 | ||