kkdcp: perform the proper encoding and decoding on exchanged data

This commit is contained in:
Nikos Mavrogiannopoulos
2015-02-19 11:47:20 +01:00
parent 6334bada15
commit 773d277802
10 changed files with 194 additions and 13 deletions
+8
View File
@@ -95,7 +95,9 @@ static struct cfg_options available_options[] = {
{ .name = "connect-script", .type = OPTION_STRING, .mandatory = 0 },
{ .name = "disconnect-script", .type = OPTION_STRING, .mandatory = 0 },
{ .name = "pid-file", .type = OPTION_STRING, .mandatory = 0 },
#ifdef HAVE_GSSAPI
{ .name = "kkdcp", .type = OPTION_STRING, .mandatory = 0 },
#endif
{ .name = "socket-file", .type = OPTION_STRING, .mandatory = 1 },
{ .name = "listen-clear-file", .type = OPTION_STRING, .mandatory = 0 },
{ .name = "occtl-socket-file", .type = OPTION_STRING, .mandatory = 0 },
@@ -525,6 +527,7 @@ static void figure_auth_funcs(struct cfg_st *config, char **auth, unsigned auth_
talloc_free(auth);
}
#ifdef HAVE_GSSAPI
static void parse_kkdcp(struct cfg_st *config, char **urlfw, unsigned urlfw_size)
{
unsigned i;
@@ -593,6 +596,7 @@ static void parse_kkdcp(struct cfg_st *config, char **urlfw, unsigned urlfw_size
config->kkdcp_size = urlfw_size;
}
#endif
static void parse_cfg_file(const char* file, struct cfg_st *config, unsigned reload)
{
@@ -656,11 +660,13 @@ unsigned urlfw_size = 0;
READ_TF("listen-host-is-dyndns", config->is_dyndns, 0);
READ_STRING("listen-clear-file", config->unix_conn_file);
#ifdef HAVE_GSSAPI
READ_MULTI_LINE("kkdcp", urlfw, urlfw_size);
if (urlfw_size > 0) {
parse_kkdcp(config, urlfw, urlfw_size);
talloc_free(urlfw);
}
#endif
READ_NUMERIC("tcp-port", config->port);
READ_NUMERIC("udp-port", config->udp_port);
@@ -1074,9 +1080,11 @@ unsigned i;
DEL(config->disconnect_script);
DEL(config->proxy_url);
#ifdef HAVE_GSSAPI
for (i=0;i<config->kkdcp_size;i++)
DEL(config->kkdcp[i].url);
DEL(config->kkdcp);
#endif
DEL(config->network.ipv4);
DEL(config->network.ipv4_netmask);