Public API for OpenELP, An Open Source EchoLink® Proxy.
More...
#include <stdint.h>
#include <unistd.h>
Go to the source code of this file.
|
int | get_nonce (uint32_t *nonce) |
| Get a single-use 32-bit number.
|
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_close (struct proxy_handle *ph) |
| Closes the proxy so no more clients can connect.
|
void | proxy_drop (struct proxy_handle *ph) |
| Drops all currently connected clients from the proxy.
|
void | proxy_free (struct proxy_handle *ph) |
| Frees data allocated by proxy_init.
|
void | proxy_ident (struct proxy_handle *ph) |
| Instructs the proxy to identify itself to the current log medium.
|
int | proxy_init (struct proxy_handle *ph) |
| Initializes the private data in a proxy_handle.
|
int | proxy_load_conf (struct proxy_handle *ph, const char *path) |
| Loads the configuration from the file at the given path.
|
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.
|
void | proxy_log_level (struct proxy_handle *ph, enum LOG_LEVEL lvl) |
| Changes the log message importance threshold.
|
int | proxy_log_select_medium (struct proxy_handle *ph, enum LOG_MEDIUM medium, const char *target) |
| Changes the target logging medium.
|
int | proxy_open (struct proxy_handle *ph) |
| Opens the proxy for client connections.
|
int | proxy_process (struct proxy_handle *ph) |
| Blocking call to process new clients.
|
void | proxy_shutdown (struct proxy_handle *ph) |
| Gracefully shut down all proxy operations asynchronously.
|
int | proxy_start (struct proxy_handle *ph) |
| Starts the client processing thread(s)
|
void | proxy_update_registration (struct proxy_handle *ph) |
| Updates the registration status of the proxy instance.
|
Public API for OpenELP, An Open Source EchoLink® Proxy.
- Copyright
- Copyright © 2016, Scott K Logan
-
All rights reserved.
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
EchoLink® is a registered trademark of Synergenics, LLC
- Author
- Scott K Logan <logan.nosp@m.s@co.nosp@m.ttsay.nosp@m..net>
DESCRIPTION
These definitions, data structures and functions manipulate and operate the proxy.
◆ PROXY_PASS_RES_LEN
#define PROXY_PASS_RES_LEN 16 |
Length in bytes of the expected password response from the client
◆ LOG_LEVEL
Severity level of log information.
Enumerator |
---|
LOG_LEVEL_FATAL | A fatal event, which will result in program termination
|
LOG_LEVEL_ERROR | A failure event which should not have happened under normal circumstances
|
LOG_LEVEL_WARN | An unusual event which could indicate a problem
|
LOG_LEVEL_INFO | An event which is part of the normal lifecycle of the program
|
LOG_LEVEL_DEBUG | A verbose event
|
◆ LOG_MEDIUM
Logging facilities to write logging events to.
Enumerator |
---|
LOG_MEDIUM_NONE | Discard all log messages
|
LOG_MEDIUM_STDOUT | Print all log messages to stdout and stderr
|
LOG_MEDIUM_FILE | Append all log messages to the given file
|
LOG_MEDIUM_SYSLOG | Send all log messages to Syslog
|
LOG_MEDIUM_EVENTLOG | Send all log messages to the Windows Event Log
|
◆ get_nonce()
int get_nonce |
( |
uint32_t * | nonce | ) |
|
Get a single-use 32-bit number.
- Parameters
-
[out] | nonce | Resulting single-use number |
- Returns
- 0 on success, negative ERRNO value on failure
◆ get_password_response()
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.
- Parameters
-
[in] | nonce | Single use number |
[in] | password | Null terminated password string |
[out] | response | Expected password response |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_authorize_callsign()
int proxy_authorize_callsign |
( |
struct proxy_handle * | ph, |
|
|
const char * | callsign ) |
Authorizes the given callsign against the proxy's configuration.
- Parameters
-
[in] | ph | Target proxy instance |
[in] | callsign | Null-terminated string containing the callsign |
- Returns
- 1 if call is authorized, 0 if not, negative ERRNO value on failure
◆ proxy_close()
Closes the proxy so no more clients can connect.
- Parameters
-
[in,out] | ph | Target proxy instance |
◆ proxy_drop()
Drops all currently connected clients from the proxy.
- Parameters
-
[in,out] | ph | Target proxy instance |
◆ proxy_free()
Frees data allocated by proxy_init.
- Parameters
-
[in,out] | ph | Target proxy instance |
◆ proxy_ident()
Instructs the proxy to identify itself to the current log medium.
- Parameters
-
[in] | ph | Target proxy instance |
◆ proxy_init()
Initializes the private data in a proxy_handle.
- Parameters
-
[in,out] | ph | Target proxy instance |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_load_conf()
int proxy_load_conf |
( |
struct proxy_handle * | ph, |
|
|
const char * | path ) |
Loads the configuration from the file at the given path.
- Parameters
-
[in,out] | ph | Target proxy instance |
[in] | path | Null-terminated string containing the path to the file |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_log()
Logs the given message to the current medium if lvl is high enough.
- Parameters
-
[in] | ph | Target proxy instance |
[in] | lvl | Message's level of importance |
[in] | fmt | String format of message |
[in] | ... | Arguments for format specification |
◆ proxy_log_level()
Changes the log message importance threshold.
- Parameters
-
[in,out] | ph | Target proxy instance |
[in] | lvl | New message importance threshold |
◆ proxy_log_select_medium()
Changes the target logging medium.
- Parameters
-
[in,out] | ph | Target proxy instance |
[in] | medium | New logging medium to use |
[in] | target | Medium target, where appropriate |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_open()
Opens the proxy for client connections.
- Parameters
-
[in,out] | ph | Target proxy instance |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_process()
Blocking call to process new clients.
- Parameters
-
[in,out] | ph | Target proxy instance |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_shutdown()
Gracefully shut down all proxy operations asynchronously.
- Parameters
-
[in,out] | ph | Target proxy instance |
◆ proxy_start()
Starts the client processing thread(s)
- Parameters
-
[in,out] | ph | Target proxy instance |
- Returns
- 0 on success, negative ERRNO value on failure
◆ proxy_update_registration()
Updates the registration status of the proxy instance.
- Parameters
-
[in] | ph | Target proxy instance |