|
OpenVPN
|


Go to the source code of this file.
Macros | |
| #define | RETURN_UPDATE_STATUS(n_sent) |
Functions | |
| int | process_push_update (struct context *c, struct options *o, 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. | |
| static size_t | find_first_comma_of_next_bundle (const char *str, size_t ix) |
Return index of last , or 0 if it didn't find any. | |
| static struct buffer | forge_msg (const char *src, const char *continuation, struct gc_arena *gc) |
| static char * | gc_strdup (const char *src, struct gc_arena *gc) |
| static bool | message_splitter (const char *s, struct buffer *msgs, struct gc_arena *gc, const size_t safe_cap) |
| static bool | send_single_push_update (struct multi_context *m, struct multi_instance *mi, struct buffer *msgs) |
| static bool | support_push_update (struct multi_instance *mi) |
| static int | send_push_update (struct multi_context *m, const void *target, const char *msg, const push_update_type type, const size_t push_bundle_size) |
| A function to send a PUSH_UPDATE control message from server to client(s). | |
| bool | management_callback_send_push_update_broadcast (void *arg, const char *options) |
| bool | management_callback_send_push_update_by_cid (void *arg, unsigned long cid, const char *options) |
| #define RETURN_UPDATE_STATUS | ( | n_sent | ) |
Definition at line 341 of file push_util.c.
|
static |
Return index of last , or 0 if it didn't find any.
If there is a comma at index 0 it's an error anyway
Definition at line 55 of file push_util.c.
Referenced by message_splitter().
|
static |
Definition at line 70 of file push_util.c.
References alloc_buf_gc(), buf_printf(), gc, buffer::len, and push_update_cmd.
Referenced by message_splitter().
|
static |
Definition at line 82 of file push_util.c.
References gc, gc_malloc(), and buffer::len.
Referenced by message_splitter().
| bool management_callback_send_push_update_broadcast | ( | void * | arg, |
| const char * | options | ||
| ) |
Definition at line 357 of file push_util.c.
References PUSH_BUNDLE_SIZE, RETURN_UPDATE_STATUS, send_push_update(), and UPT_BROADCAST.
Referenced by init_management_callback_multi().
| bool management_callback_send_push_update_by_cid | ( | void * | arg, |
| unsigned long | cid, | ||
| const char * | options | ||
| ) |
Definition at line 365 of file push_util.c.
References PUSH_BUNDLE_SIZE, RETURN_UPDATE_STATUS, send_push_update(), and UPT_BY_CID.
Referenced by init_management_callback_multi().
|
static |
Definition at line 94 of file push_util.c.
References find_first_comma_of_next_bundle(), forge_msg(), gc, gc_strdup(), i, and buffer::len.
Referenced by send_push_update().
| int process_push_update | ( | struct context * | c, |
| struct options * | o, | ||
| 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.
This function processes a push-update message, validating its content and applying updates to the options specified in the message. It also handles split messages if the complete message has not yet been received.
| c | The context for the operation. |
| o | The options structure to be updated with the received push options. |
| permission_mask | The permission mask specifying which options are allowed to be pulled. |
| option_types_found | A pointer to a variable that will be filled with the types of options found in the message. |
| buf | A buffer containing the received message. |
| msg_sender | A boolean indicating if the message is being processed on the client (false) or on the server (true). |
PUSH_MSG_UPDATE: The message was processed successfully, and the updates were applied.PUSH_MSG_CONTINUATION: The message is a fragment of a larger message, and the program is waiting for the final part.PUSH_MSG_ERROR: An error occurred during message processing, or the message is invalid. Definition at line 14 of file push_util.c.
References apply_push_options(), buf_read_u8(), context::c2, context_2::es, options::push_continuation, PUSH_MSG_CONTINUATION, PUSH_MSG_ERROR, PUSH_MSG_UPDATE, and throw_signal_soft().
Referenced by process_incoming_push_msg(), and send_single_push_update().
|
static |
A function to send a PUSH_UPDATE control message from server to client(s).
| m | the multi_context, contains all the clients connected to this server. |
| target | the target to which to send the message. It should be: NULL if type == UPT_BROADCAST, a mroute_addr * if type == UPT_BY_ADDR, a char * if type == UPT_BY_CN, an unsigned long * if type == UPT_BY_CID. |
| msg | a string containing the options to send. |
| type | the way to address the message (broadcast, by cid, by cn, by address). |
| push_bundle_size | the maximum size of a bundle of pushed option. Just use PUSH_BUNDLE_SIZE macro. |
Definition at line 252 of file push_util.c.
References ASSERT, context::c2, multi_instance::context, dco_enabled(), gc, gc_free(), gc_malloc(), gc_new(), multi_instance::halt, hash_iterator_free(), hash_iterator_init(), hash_iterator_next(), multi_context::iter, buffer::len, lookup_by_cid(), M_CLIENT, M_WARN, message_splitter(), msg, tls_multi::peer_id, push_update_cmd, send_single_push_update(), support_push_update(), context_2::tls_multi, UPT_BROADCAST, UPT_BY_CID, and hash_element::value.
Referenced by management_callback_send_push_update_broadcast(), management_callback_send_push_update_by_cid(), test_send_push_msg0(), test_send_push_msg1(), test_send_push_msg10(), test_send_push_msg2(), test_send_push_msg3(), test_send_push_msg4(), test_send_push_msg5(), test_send_push_msg6(), test_send_push_msg7(), test_send_push_msg8(), and test_send_push_msg9().
|
static |
Definition at line 141 of file push_util.c.
References BSTR, buf_string_compare_advance(), context::c2, CLEAR, multi_instance::context, D_PUSH, buffer::data, i, options::ifconfig_ipv6_local, options::ifconfig_local, buffer::len, M_WARN, msg, OPT_P_UP, process_push_update(), pull_permission_mask(), context_2::push_ifconfig_defined, context_2::push_ifconfig_ipv6_defined, PUSH_MSG_ERROR, push_update_cmd, send_control_channel_string(), unlearn_ifconfig(), unlearn_ifconfig_ipv6(), and update_vhash().
Referenced by send_push_update().
|
static |
Definition at line 225 of file push_util.c.
References ASSERT, context::c2, multi_instance::context, extract_iv_proto(), IV_PROTO_PUSH_UPDATE, buffer::len, tls_multi::peer_info, and context_2::tls_multi.
Referenced by send_push_update().