static void l2tp_api_xdr_free_ppp_profile_msg_data(caddr_t addr) { struct l2tp_api_ppp_profile_msg_data *msg = (void *) addr; if (msg->profile_name != NULL) free(msg->profile_name); if (OPTSTRING_PTR(msg->ip_pool_name) != NULL) free(OPTSTRING(msg->ip_pool_name)); if (OPTSTRING_PTR(msg->radius_hint) != NULL) free(OPTSTRING(msg->radius_hint)); }
static void l2tp_api_xdr_free_peer_profile_msg_data(caddr_t addr) { struct l2tp_api_peer_profile_msg_data *msg = (void *) addr; if (msg->profile_name != NULL) free(msg->profile_name); if (OPTSTRING_PTR(msg->default_tunnel_profile_name) != NULL) free(OPTSTRING(msg->default_tunnel_profile_name)); if (OPTSTRING_PTR(msg->default_session_profile_name) != NULL) free(OPTSTRING(msg->default_session_profile_name)); if (OPTSTRING_PTR(msg->default_ppp_profile_name) != NULL) free(OPTSTRING(msg->default_ppp_profile_name)); }
static void l2tp_api_xdr_free_session_profile_msg_data(caddr_t addr) { struct l2tp_api_session_profile_msg_data *msg = (void *) addr; if (msg->profile_name != NULL) free(msg->profile_name); if (OPTSTRING_PTR(msg->ppp_profile_name) != NULL) free(OPTSTRING(msg->ppp_profile_name)); if (OPTSTRING_PTR(msg->priv_group_id) != NULL) free(OPTSTRING(msg->priv_group_id)); }
/* * Copy options */ struct sshauthopt * sshauthopt_copy(const struct sshauthopt *orig) { struct sshauthopt *ret; if ((ret = sshauthopt_new()) == NULL) return NULL; #define OPTSCALAR(x) ret->x = orig->x OPTSCALAR(permit_port_forwarding_flag); OPTSCALAR(permit_agent_forwarding_flag); OPTSCALAR(permit_x11_forwarding_flag); OPTSCALAR(permit_pty_flag); OPTSCALAR(permit_user_rc); OPTSCALAR(restricted); OPTSCALAR(cert_authority); OPTSCALAR(force_tun_device); OPTSCALAR(valid_before); #undef OPTSCALAR #define OPTSTRING(x) \ do { \ if (orig->x != NULL && (ret->x = strdup(orig->x)) == NULL) { \ sshauthopt_free(ret); \ return NULL; \ } \ } while (0) OPTSTRING(cert_principals); OPTSTRING(force_command); OPTSTRING(required_from_host_cert); OPTSTRING(required_from_host_keys); #undef OPTSTRING if (dup_strings(&ret->env, &ret->nenv, orig->env, orig->nenv) != 0 || dup_strings(&ret->permitopen, &ret->npermitopen, orig->permitopen, orig->npermitopen) != 0) { sshauthopt_free(ret); return NULL; } return ret; }
static void l2tp_api_xdr_free_tunnel_msg_data(caddr_t addr) { struct l2tp_api_tunnel_msg_data *msg = (void *) addr; if (OPTSTRING_PTR(msg->tunnel_name) != NULL) free(OPTSTRING(msg->tunnel_name)); if (OPTSTRING_PTR(msg->state) != NULL) free(OPTSTRING(msg->state)); if (OPTSTRING_PTR(msg->secret) != NULL) free(OPTSTRING(msg->secret)); if (OPTSTRING_PTR(msg->host_name) != NULL) free(OPTSTRING(msg->host_name)); if (OPTSTRING_PTR(msg->tunnel_profile_name) != NULL) free(OPTSTRING(msg->tunnel_profile_name)); if (OPTSTRING_PTR(msg->peer_profile_name) != NULL) free(OPTSTRING(msg->peer_profile_name)); if (msg->tiebreaker.tiebreaker_val != NULL) free(msg->tiebreaker.tiebreaker_val); if (OPTSTRING_PTR(msg->session_profile_name) != NULL) free(OPTSTRING(msg->session_profile_name)); if (OPTSTRING_PTR(msg->ppp_profile_name) != NULL) free(OPTSTRING(msg->ppp_profile_name)); if (OPTSTRING_PTR(msg->interface_name) != NULL) free(OPTSTRING(msg->interface_name)); if (OPTSTRING_PTR(msg->result_code_message) != NULL) free(OPTSTRING(msg->result_code_message)); if (OPTSTRING_PTR(msg->peer.host_name) != NULL) free(OPTSTRING(msg->peer.host_name)); if (OPTSTRING_PTR(msg->peer.vendor_name) != NULL) free(OPTSTRING(msg->peer.vendor_name)); if (msg->peer.tiebreaker.tiebreaker_val != NULL) free(msg->peer.tiebreaker.tiebreaker_val); if (OPTSTRING_PTR(msg->peer.result_code_message) != NULL) free(OPTSTRING(msg->peer.result_code_message)); if (OPTSTRING_PTR(msg->create_time) != NULL) free(OPTSTRING(msg->create_time)); }
static void l2tp_api_xdr_free_session_msg_data(caddr_t addr) { struct l2tp_api_session_msg_data *msg = (void *) addr; if (OPTSTRING_PTR(msg->tunnel_name) != NULL) free(OPTSTRING(msg->tunnel_name)); if (OPTSTRING_PTR(msg->state) != NULL) free(OPTSTRING(msg->state)); if (OPTSTRING_PTR(msg->session_name) != NULL) free(OPTSTRING(msg->session_name)); if (OPTSTRING_PTR(msg->interface_name) != NULL) free(OPTSTRING(msg->interface_name)); if (OPTSTRING_PTR(msg->user_name) != NULL) free(OPTSTRING(msg->user_name)); if (OPTSTRING_PTR(msg->user_password) != NULL) free(OPTSTRING(msg->user_password)); if (OPTSTRING_PTR(msg->priv_group_id) != NULL) free(OPTSTRING(msg->priv_group_id)); if (OPTSTRING_PTR(msg->profile_name) != NULL) free(OPTSTRING(msg->profile_name)); if (msg->proxy_auth_challenge.proxy_auth_challenge_val != NULL) free(msg->proxy_auth_challenge.proxy_auth_challenge_val); if (msg->proxy_auth_response.proxy_auth_response_val != NULL) free(msg->proxy_auth_response.proxy_auth_response_val); if (OPTSTRING_PTR(msg->proxy_auth_name) != NULL) free(OPTSTRING(msg->proxy_auth_name)); if (OPTSTRING_PTR(msg->calling_number) != NULL) free(OPTSTRING(msg->calling_number)); if (OPTSTRING_PTR(msg->called_number) != NULL) free(OPTSTRING(msg->called_number)); if (OPTSTRING_PTR(msg->sub_address) != NULL) free(OPTSTRING(msg->sub_address)); if (msg->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val != NULL) free(msg->initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val); if (msg->last_sent_lcp_confreq.last_sent_lcp_confreq_val != NULL) free(msg->last_sent_lcp_confreq.last_sent_lcp_confreq_val); if (msg->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val != NULL) free(msg->last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val); if (OPTSTRING_PTR(msg->ppp_profile_name) != NULL) free(OPTSTRING(msg->ppp_profile_name)); if (msg->peer.proxy_auth_challenge.proxy_auth_challenge_val != NULL) free(msg->peer.proxy_auth_challenge.proxy_auth_challenge_val); if (msg->peer.proxy_auth_response.proxy_auth_response_val != NULL) free(msg->peer.proxy_auth_response.proxy_auth_response_val); if (OPTSTRING_PTR(msg->peer.private_group_id) != NULL) free(OPTSTRING(msg->peer.private_group_id)); if (msg->peer.initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val != NULL) free(msg->peer.initial_rcvd_lcp_confreq.initial_rcvd_lcp_confreq_val); if (msg->peer.last_sent_lcp_confreq.last_sent_lcp_confreq_val != NULL) free(msg->peer.last_sent_lcp_confreq.last_sent_lcp_confreq_val); if (msg->peer.last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val != NULL) free(msg->peer.last_rcvd_lcp_confreq.last_rcvd_lcp_confreq_val); if (OPTSTRING_PTR(msg->peer.calling_number) != NULL) free(OPTSTRING(msg->peer.calling_number)); if (OPTSTRING_PTR(msg->peer.called_number) != NULL) free(OPTSTRING(msg->peer.called_number)); if (OPTSTRING_PTR(msg->peer.sub_address) != NULL) free(OPTSTRING(msg->peer.sub_address)); if (OPTSTRING_PTR(msg->create_time) != NULL) free(OPTSTRING(msg->create_time)); }