Lines Matching refs:hndl

102 static uint16_t rmnetctl_transact(rmnetctl_hndl_t *hndl,  in rmnetctl_transact()  argument
116 if (!hndl){ in rmnetctl_transact()
146 nlmsghdr_val->nlmsg_seq = hndl->transaction_id; in rmnetctl_transact()
147 nlmsghdr_val->nlmsg_pid = hndl->pid; in rmnetctl_transact()
154 hndl->transaction_id++; in rmnetctl_transact()
156 saddr_ptr = &hndl->dest_addr; in rmnetctl_transact()
158 if (sendto(hndl->netlink_fd, in rmnetctl_transact()
170 saddr_ptr = &hndl->src_addr; in rmnetctl_transact()
171 bytes_read = recvfrom(hndl->netlink_fd, in rmnetctl_transact()
310 int rmnetctl_init(rmnetctl_hndl_t **hndl, uint16_t *error_code) in rmnetctl_init() argument
316 if ((!hndl) || (!error_code)){ in rmnetctl_init()
321 *hndl = (rmnetctl_hndl_t *)malloc(sizeof(rmnetctl_hndl_t)); in rmnetctl_init()
322 if (!*hndl) { in rmnetctl_init()
327 memset(*hndl, 0, sizeof(rmnetctl_hndl_t)); in rmnetctl_init()
331 free(*hndl); in rmnetctl_init()
335 (*hndl)->pid = (uint32_t)pid; in rmnetctl_init()
338 free(*hndl); in rmnetctl_init()
343 (*hndl)->netlink_fd = netlink_fd; in rmnetctl_init()
345 memset(&(*hndl)->src_addr, 0, sizeof(struct sockaddr_nl)); in rmnetctl_init()
347 (*hndl)->src_addr.nl_family = AF_NETLINK; in rmnetctl_init()
348 (*hndl)->src_addr.nl_pid = (*hndl)->pid; in rmnetctl_init()
350 saddr_ptr = &(*hndl)->src_addr; in rmnetctl_init()
351 if (bind((*hndl)->netlink_fd, in rmnetctl_init()
354 close((*hndl)->netlink_fd); in rmnetctl_init()
355 free(*hndl); in rmnetctl_init()
360 memset(&(*hndl)->dest_addr, 0, sizeof(struct sockaddr_nl)); in rmnetctl_init()
362 (*hndl)->dest_addr.nl_family = AF_NETLINK; in rmnetctl_init()
363 (*hndl)->dest_addr.nl_pid = KERNEL_PROCESS_ID; in rmnetctl_init()
364 (*hndl)->dest_addr.nl_groups = UNICAST; in rmnetctl_init()
371 void rmnetctl_cleanup(rmnetctl_hndl_t *hndl) in rmnetctl_cleanup() argument
373 if (!hndl) in rmnetctl_cleanup()
375 close(hndl->netlink_fd); in rmnetctl_cleanup()
376 free(hndl); in rmnetctl_cleanup()
379 int rmnet_associate_network_device(rmnetctl_hndl_t *hndl, in rmnet_associate_network_device() argument
388 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_associate_network_device()
405 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_associate_network_device()
415 int rmnet_get_network_device_associated(rmnetctl_hndl_t *hndl, in rmnet_get_network_device_associated() argument
423 if ((!hndl) || (!register_status) || (!error_code) || in rmnet_get_network_device_associated()
436 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_network_device_associated()
449 int rmnet_set_link_egress_data_format(rmnetctl_hndl_t *hndl, in rmnet_set_link_egress_data_format() argument
459 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_set_link_egress_data_format()
479 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_link_egress_data_format()
491 int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl, in rmnet_get_link_egress_data_format() argument
501 if ((!hndl) || (!egress_flags) || (!agg_size) || (!agg_count) || in rmnet_get_link_egress_data_format()
515 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_link_egress_data_format()
530 int rmnet_set_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl, in rmnet_set_link_ingress_data_format_tailspace() argument
539 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_set_link_ingress_data_format_tailspace()
557 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_link_ingress_data_format_tailspace()
569 int rmnet_get_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl, in rmnet_get_link_ingress_data_format_tailspace() argument
578 if ((!hndl) || (!error_code) || in rmnet_get_link_ingress_data_format_tailspace()
593 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_link_ingress_data_format_tailspace()
611 int rmnet_set_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_set_logical_ep_config() argument
621 if ((!hndl) || ((ep_id < -1) || (ep_id > 31)) || (!error_code) || in rmnet_set_logical_ep_config()
647 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_logical_ep_config()
658 int rmnet_unset_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_unset_logical_ep_config() argument
667 if ((!hndl) || ((ep_id < -1) || (ep_id > 31)) || (!error_code) || in rmnet_unset_logical_ep_config()
685 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_unset_logical_ep_config()
697 int rmnet_get_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_get_logical_ep_config() argument
708 if ((!hndl) || (!operating_mode) || (!error_code) || ((ep_id < -1) || in rmnet_get_logical_ep_config()
726 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_logical_ep_config()
744 int rmnet_new_vnd_prefix(rmnetctl_hndl_t *hndl, in rmnet_new_vnd_prefix() argument
754 if ((!hndl) || (!error_code) || in rmnet_new_vnd_prefix()
779 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_new_vnd_prefix()
790 int rmnet_new_vnd(rmnetctl_hndl_t *hndl, in rmnet_new_vnd() argument
795 return rmnet_new_vnd_prefix(hndl, id, error_code, new_vnd, 0); in rmnet_new_vnd()
798 int rmnet_get_vnd_name(rmnetctl_hndl_t *hndl, in rmnet_get_vnd_name() argument
808 if ((!hndl) || (!error_code) || (!buf) || (0 == buflen)) { in rmnet_get_vnd_name()
818 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_vnd_name()
837 int rmnet_add_del_vnd_tc_flow(rmnetctl_hndl_t *hndl, in rmnet_add_del_vnd_tc_flow() argument
846 if ((!hndl) || (!error_code) || ((set_flow != RMNETCTL_ADD_FLOW) && in rmnet_add_del_vnd_tc_flow()
861 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_add_del_vnd_tc_flow()