OpenELP 0.9.2
An Open Source EchoLink® Proxy
openelp.h
Go to the documentation of this file.
1
52#ifndef OPENELP_H_
53#define OPENELP_H_
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
59#include <stdint.h>
60
61#ifndef _WIN32
62# include <unistd.h>
63#endif
64
65#ifndef OPENELP_API
67# define OPENELP_API
68#endif
69
71#define PROXY_PASS_RES_LEN 16
72
79
82
85
88
91};
92
99
102
105
108
112
123
126
129
132
135
137 char *password;
138
140 char *reg_name;
141
144
147
150
153
155 uint16_t port;
156};
157
167 void *priv;
168
171};
172
180int OPENELP_API get_nonce(uint32_t *nonce);
181
191int OPENELP_API get_password_response(uint32_t nonce, const char *password,
192 uint8_t response[PROXY_PASS_RES_LEN]);
193
202int OPENELP_API proxy_authorize_callsign(struct proxy_handle *ph,
203 const char *callsign);
204
210void OPENELP_API proxy_close(struct proxy_handle *ph);
211
217void OPENELP_API proxy_drop(struct proxy_handle *ph);
218
224void OPENELP_API proxy_free(struct proxy_handle *ph);
225
231void OPENELP_API proxy_ident(struct proxy_handle *ph);
232
240int OPENELP_API proxy_init(struct proxy_handle *ph);
241
250int OPENELP_API proxy_load_conf(struct proxy_handle *ph, const char *path);
251
260void OPENELP_API proxy_log(struct proxy_handle *ph, enum LOG_LEVEL lvl,
261 const char *fmt, ...);
262
269void OPENELP_API proxy_log_level(struct proxy_handle *ph, enum LOG_LEVEL lvl);
270
280int OPENELP_API proxy_log_select_medium(struct proxy_handle *ph,
281 enum LOG_MEDIUM medium,
282 const char *target);
283
291int OPENELP_API proxy_open(struct proxy_handle *ph);
292
300int OPENELP_API proxy_process(struct proxy_handle *ph);
301
307void OPENELP_API proxy_shutdown(struct proxy_handle *ph);
308
316int OPENELP_API proxy_start(struct proxy_handle *ph);
317
323void OPENELP_API proxy_update_registration(struct proxy_handle *ph);
324
325#ifdef __cplusplus
326}
327#endif
328
329#endif /* OPENELP_H_ */
int proxy_init(struct proxy_handle *ph)
Initializes the private data in a proxy_handle.
int get_nonce(uint32_t *nonce)
Get a single-use 32-bit number.
LOG_MEDIUM
Logging facilities to write logging events to.
Definition: openelp.h:96
@ LOG_MEDIUM_SYSLOG
Definition: openelp.h:107
@ LOG_MEDIUM_STDOUT
Definition: openelp.h:101
@ LOG_MEDIUM_EVENTLOG
Definition: openelp.h:110
@ LOG_MEDIUM_NONE
Definition: openelp.h:98
@ LOG_MEDIUM_FILE
Definition: openelp.h:104
#define PROXY_PASS_RES_LEN
Definition: openelp.h:71
int proxy_process(struct proxy_handle *ph)
Blocking call to process new clients.
void proxy_free(struct proxy_handle *ph)
Frees data allocated by proxy_init.
void proxy_shutdown(struct proxy_handle *ph)
Gracefully shut down all proxy operations asynchronously.
int proxy_log_select_medium(struct proxy_handle *ph, enum LOG_MEDIUM medium, const char *target)
Changes the target logging medium.
void proxy_update_registration(struct proxy_handle *ph)
Updates the registration status of the proxy instance.
int proxy_open(struct proxy_handle *ph)
Opens the proxy for client connections.
void proxy_log(struct proxy_handle *ph, enum LOG_LEVEL lvl, const char *fmt,...)
Logs the given message to the current medium if lvl is high enough.
LOG_LEVEL
Severity level of log information.
Definition: openelp.h:76
@ LOG_LEVEL_DEBUG
Definition: openelp.h:90
@ LOG_LEVEL_ERROR
Definition: openelp.h:81
@ LOG_LEVEL_FATAL
Definition: openelp.h:78
@ LOG_LEVEL_WARN
Definition: openelp.h:84
@ LOG_LEVEL_INFO
Definition: openelp.h:87
void proxy_drop(struct proxy_handle *ph)
Drops all currently connected clients from the proxy.
int proxy_start(struct proxy_handle *ph)
Starts the client processing thread(s)
void proxy_log_level(struct proxy_handle *ph, enum LOG_LEVEL lvl)
Changes the log message importance threshold.
int proxy_load_conf(struct proxy_handle *ph, const char *path)
Loads the configuration from the file at the given path.
int get_password_response(uint32_t nonce, const char *password, uint8_t response[PROXY_PASS_RES_LEN])
Gets the expected response for a given nonce and password.
int proxy_authorize_callsign(struct proxy_handle *ph, const char *callsign)
Authorizes the given callsign against the proxy's configuration.
void proxy_ident(struct proxy_handle *ph)
Instructs the proxy to identify itself to the current log medium.
void proxy_close(struct proxy_handle *ph)
Closes the proxy so no more clients can connect.
Configuration instance for a proxy_handle.
Definition: openelp.h:120
char ** bind_addr_ext_add
Definition: openelp.h:128
char * password
Definition: openelp.h:137
char * reg_name
Definition: openelp.h:140
char * public_addr
Definition: openelp.h:146
uint16_t bind_addr_ext_add_len
Definition: openelp.h:152
uint16_t port
Definition: openelp.h:155
char * calls_allowed
Definition: openelp.h:131
char * reg_comment
Definition: openelp.h:143
char * bind_addr_ext
Definition: openelp.h:125
char * bind_addr
Definition: openelp.h:122
uint32_t connection_timeout
Definition: openelp.h:149
char * calls_denied
Definition: openelp.h:134
Represents an instance of an EchoLink proxy.
Definition: openelp.h:165
struct proxy_conf conf
Definition: openelp.h:170
void * priv
Definition: openelp.h:167