34 #ifdef HAVE_SYS_STAT_H
35 # include <sys/stat.h>
40 #define DLLEXPORT __declspec(dllexport)
41 #define C2S_API __declspec(dllimport)
43 #define DLLEXPORT __declspec(dllimport)
44 #define C2S_API __declspec(dllexport)
117 #define AR_MECH_TRAD_PLAIN (1<<0)
118 #define AR_MECH_TRAD_DIGEST (1<<1)
119 #define AR_MECH_TRAD_CRAMMD5 (1<<2)
325 int (*
user_exists)(authreg_t ar,
const char *username,
const char *realm);
328 int (*
get_password)(authreg_t ar,
const char *username,
const char *realm,
char password[257]);
331 int (*
check_password)(authreg_t ar,
const char *username,
const char *realm,
char password[257]);
334 int (*
set_password)(authreg_t ar,
const char *username,
const char *realm,
char password[257]);
337 int (*
create_user)(authreg_t ar,
const char *username,
const char *realm);
338 int (*
delete_user)(authreg_t ar,
const char *username,
const char *realm);
345 int (*
user_authz_allowed)(authreg_t ar,
const char *username,
const char *realm,
const char *requested_user);
348 int (*
create_challenge)(authreg_t ar,
const char *username,
const char *challenge,
int maxlen);
349 int (*
check_response)(authreg_t ar,
const char *username,
const char *realm,
const char *challenge,
const char *response);
C2S_API void sm_create(sess_t sess, bres_t res)
int address_init(sx_env_t env, sx_plugin_t p, va_list args)
args: none
int io_check_interval
time checks
C2S_API void sm_end(sess_t sess, bres_t res)
int(* check_response)(authreg_t ar, const char *username, const char *realm, const char *challenge, const char *response)
int(* delete_user)(authreg_t ar, const char *username, const char *realm)
struct stream_redirect_st * stream_redirect_t
const char * log_facility
char sm_request[41]
this holds the id of the current pending SM request
const char * http_forward
http forwarding URL
int ar_register_enable
registration
int started
this is true if we've connected to the router at least once
unsigned int packet_count
access_t access
access controls
int(* check_password)(authreg_t ar, const char *username, const char *realm, char password[257])
check the given password against the stored password, 0 if equal, !0 if not equal (password auth) ...
int compression
enable Stream Compression
C2S_API void sm_packet(sess_t sess, bres_t res, nad_t nad)
list of resources bound to session
int io_max_fds
max file descriptors
char * host_private_key_password
private key password
int ar_mechanisms
allowed mechanisms
holder for the config hash and nad
const char * id
our id (hostname) with the router
mio_action_t
these are the actions and a handler type assigned by the applicaiton using mio
int host_verify_mode
verify-mode
int bind_init(sx_env_t env, sx_plugin_t p, va_list args)
plugin initialiser
int stanza_size_limit
maximum stanza size
sx_t router
router's conn
mio_fd_t server_fd
listening sockets
const char * router_pemfile
const char * router_cachain
const char * router_ip
how to connect to the router
const char * local_ip
ip to listen on
int authreg_process(c2s_t c2s, sess_t sess, nad_t nad)
processor for iq:auth and iq:register packets return 0 if handled, 1 if not handled ...
const char * router_private_key_password
holds the state for a single stream
const char * ar_register_instructions
int(* user_exists)(authreg_t ar, const char *username, const char *realm)
returns 1 if the user exists, 0 if not
const char * realm
our realm (SASL)
host_t host
host this session belongs to
int local_verify_mode
verify-mode
int local_port
unencrypted port
int(* create_user)(authreg_t ar, const char *username, const char *realm)
make or break the user (register / register remove)
const char * host_pemfile
starttls pemfile
int conn_rate_total
connection rates
int c2s_router_sx_callback(sx_t s, sx_event_t e, void *data, void *arg)
struct authreg_st * authreg_t
sx_env_t sx_env
sx environment
int retry_init
connect retry
char c2s_id[44]
session id for this jid for us and them
xht sm_avail
availability of sms that we are servicing
C2S_API void sm_start(sess_t sess, bres_t res)
xht stream_redirects
stream redirection (see-other-host) on session connect
log_type_t log_type
log data
sig_atomic_t c2s_lost_router
jqueue_t dead_sess
list of sess on the way out
int(* ar_module_init_fn)(authreg_t)
type for the module init function
There is one instance of this struct per user who is logged in to this c2s instance.
C2S_API void c2s_pbx_init(c2s_t c2s)
long long int packet_count
packet counter
int(* create_challenge)(authreg_t ar, const char *username, const char *challenge, int maxlen)
Apple extensions for challenge/response authentication methods.
void(* free)(authreg_t ar)
const char * packet_stats
const char * ar_module_name
auth/reg module
char auth_challenge[65]
Apple: session challenge for challenge-response authentication.
int local_ssl_port
encrypted port
void authreg_free(authreg_t ar)
shutdown the authreg system
sx_event_t
things that can happen
const char * ar_register_oob
jqueue_t dead
list of sx_t on the way out
int(* user_authz_allowed)(authreg_t ar, const char *username, const char *realm, const char *requested_user)
returns 1 if the user is permitted to authorize as the requested_user, 0 if not.
const char * pbx_pipe
PBX integration named pipe.
int(* get_password)(authreg_t ar, const char *username, const char *realm, char password[257])
return this users cleartext password in the array (digest auth, password auth)
int host_require_starttls
require starttls
authreg_t authreg_init(c2s_t c2s, const char *name)
get a handle for the named module
const char * local_private_key_password
private key password
int(* set_password)(authreg_t ar, const char *username, const char *realm, char password[257])
store this password (register)
int online
true if we're bound in the router
int c2s_router_mio_callback(mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg)
C2S_API void sm_delete(sess_t sess, bres_t res)
int stanza_rate_total
stanza rates
const char * local_pemfile
encrypted port pemfile
const char * local_cachain
encrypted port cachain file
const char * host_cachain
certificate chain
int byte_rate_total
byte rates (karma)