8#ifdef ENABLE_MANAGEMENT
14 unsigned int *option_types_found,
struct buffer *buf,
49#ifdef ENABLE_MANAGEMENT
72 int src_len = strlen(src);
73 int con_len = continuation ? strlen(continuation) : 0;
172 msg(
M_WARN,
"Failed to process push update message sent to client ID: %u",
173 c->c2.tls_multi ?
c->c2.tls_multi->peer_id :
UINT32_MAX);
176 c->options.push_option_types_found |= *option_types_found;
179 msg(
M_WARN,
"Failed to post-process push update message sent to client ID: %u",
180 c->c2.tls_multi ?
c->c2.tls_multi->peer_id :
UINT32_MAX);
200 const int safe_cap = push_bundle_size - extra;
201 int msgs_num = (strlen(
msg) / safe_cap) + ((strlen(
msg) % safe_cap) != 0);
204 unsigned int option_types_found = 0;
256 option_types_found = 0;
261 msg(
M_CLIENT,
"ERROR: Peer ID: %u has not been updated",
277#define RETURN_UPDATE_STATUS(n_sent) \
282 msg(M_CLIENT, "SUCCESS: %d client(s) updated", (n_sent)); \
287 msg(M_CLIENT, "ERROR: no client updated"); \
bool buf_string_compare_advance(struct buffer *src, const char *match)
bool buf_printf(struct buffer *buf, const char *format,...)
void * gc_malloc(size_t size, bool clear, struct gc_arena *a)
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
static int buf_read_u8(struct buffer *buf)
static void gc_free(struct gc_arena *a)
static struct gc_arena gc_new(void)
bool send_control_channel_string(struct context *c, const char *str, int msglevel)
unsigned int pull_permission_mask(const struct context *c)
void hash_iterator_free(struct hash_iterator *hi)
struct hash_element * hash_iterator_next(struct hash_iterator *hi)
void hash_iterator_init(struct hash *hash, struct hash_iterator *hi)
struct multi_instance * lookup_by_cid(struct multi_context *m, const unsigned long cid)
void update_vhash(struct multi_context *m, struct multi_instance *mi, const char *old_ip, const char *old_ipv6)
Update the vhash with new IP/IPv6 addresses in the multi_context when a push-update message containin...
Header file for server-mode related structures and functions.
bool options_postprocess_pull(struct options *o, struct env_set *es)
bool apply_push_options(struct context *c, struct options *options, struct buffer *buf, unsigned int permission_mask, unsigned int *option_types_found, struct env_set *es, bool is_update)
#define PUSH_MSG_CONTINUATION
static bool message_splitter(const char *s, struct buffer *msgs, struct gc_arena *gc, const int safe_cap)
static struct buffer forge_msg(const char *src, const char *continuation, struct gc_arena *gc)
static int find_first_comma_of_next_bundle(const char *str, int ix)
Return index of last , or 0 if it didn't find any.
int send_push_update(struct multi_context *m, const void *target, const char *msg, const push_update_type type, const int push_bundle_size)
A function to send a PUSH_UPDATE control message from server to client(s).
#define RETURN_UPDATE_STATUS(n_sent)
bool management_callback_send_push_update_by_cid(void *arg, unsigned long cid, const char *options)
bool management_callback_send_push_update_broadcast(void *arg, const char *options)
static char * gc_strdup(const char *src, struct gc_arena *gc)
static bool send_single_push_update(struct context *c, struct buffer *msgs, unsigned int *option_types_found)
int process_incoming_push_update(struct context *c, unsigned int permission_mask, unsigned int *option_types_found, struct buffer *buf, bool msg_sender)
Handles the receiving of a push-update message and applies updates to the specified options.
void throw_signal_soft(const int signum, const char *signal_text)
Throw a soft global signal.
Wrapper structure for dynamically allocated memory.
uint8_t * data
Pointer to the allocated memory.
int len
Length in bytes of the actual content within the allocated memory.
struct tls_multi * tls_multi
TLS state structure for this VPN tunnel.
Contains all state information for one tunnel.
struct context_2 c2
Level 2 context.
struct options options
Options loaded from command line or configuration file.
Garbage collection arena used to keep track of dynamically allocated memory.
Main OpenVPN server state structure.
struct hash * iter
VPN tunnel instances indexed by real address of the remote peer, optimized for iteration.
Server-mode state structure for one single VPN tunnel.
struct context context
The context structure storing state for this VPN tunnel.
const char * ifconfig_ipv6_local
const char * ifconfig_local