Go to the documentation of this file.
25 #elif defined(_MSC_VER)
42 const char *var_start = strstr(peer_info, var);
49 var_start += strlen(var);
50 const char *var_end = strstr(var_start,
"\n");
54 var_end = var_start + strlen(var_start);
59 var_value[var_end - var_start] =
'\0';
66 const char *optstr = peer_info ? strstr(peer_info,
"IV_PROTO=") : NULL;
70 int r = sscanf(optstr,
"IV_PROTO=%d", &proto);
71 if (r == 1 && proto > 0)
91 const char *tmp = strstr(
options,
",link-mtu");
99 if (sscanf(tmp,
",link-mtu %d,", &link_mtu) != 1 || link_mtu < 100 || link_mtu > 9900)
111 buf_printf(&buf,
",link-mtu %d", link_mtu + 1);
113 tmp += strlen(
",link-mtu ") + (link_mtu < 1000 ? 3 : 4);
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
char * string_alloc(const char *str, struct gc_arena *gc)
Wrapper structure for dynamically allocated memory.
static bool buf_write(struct buffer *dest, const void *src, size_t size)
Garbage collection arena used to keep track of dynamically allocated memory.
unsigned int extract_iv_proto(const char *peer_info)
Extracts the IV_PROTO variable and returns its value or 0 if it cannot be extracted.
const char * options_string_compat_lzo(const char *options, struct gc_arena *gc)
Takes a locally produced OCC string for TLS server mode and modifies as if the option comp-lzo was en...
char * extract_var_peer_info(const char *peer_info, const char *var, struct gc_arena *gc)
Extracts a variable from peer info, the returned string will be allocated using the supplied gc_arena...
bool buf_printf(struct buffer *buf, const char *format,...)