Lines Matching refs:hndl

91 static int rmnetctl_transact(rmnetctl_hndl_t *hndl,  in rmnetctl_transact()  argument
103 if (!hndl){ in rmnetctl_transact()
133 nlmsghdr_val->nlmsg_seq = hndl->transaction_id; in rmnetctl_transact()
134 nlmsghdr_val->nlmsg_pid = hndl->pid; in rmnetctl_transact()
141 hndl->transaction_id++; in rmnetctl_transact()
144 if (sendto(hndl->netlink_fd, in rmnetctl_transact()
148 (struct sockaddr *) &hndl->dest_addr, in rmnetctl_transact()
156 bytes_read = recvfrom(hndl->netlink_fd, in rmnetctl_transact()
160 (struct sockaddr *) &hndl->src_addr, in rmnetctl_transact()
292 int rmnetctl_init(rmnetctl_hndl_t **hndl, uint16_t *error_code) in rmnetctl_init() argument
296 if ((!hndl) || (!error_code)){ in rmnetctl_init()
301 *hndl = (rmnetctl_hndl_t *)malloc(sizeof(rmnetctl_hndl_t)); in rmnetctl_init()
302 if (!*hndl) { in rmnetctl_init()
307 memset(*hndl, 0, sizeof(rmnetctl_hndl_t)); in rmnetctl_init()
311 free(*hndl); in rmnetctl_init()
315 (*hndl)->pid = pid; in rmnetctl_init()
318 free(*hndl); in rmnetctl_init()
323 (*hndl)->netlink_fd = netlink_fd; in rmnetctl_init()
325 memset(&(*hndl)->src_addr, 0, sizeof(struct sockaddr_nl)); in rmnetctl_init()
327 (*hndl)->src_addr.nl_family = AF_NETLINK; in rmnetctl_init()
328 (*hndl)->src_addr.nl_pid = (*hndl)->pid; in rmnetctl_init()
330 if (bind((*hndl)->netlink_fd, in rmnetctl_init()
331 (struct sockaddr *)&(*hndl)->src_addr, in rmnetctl_init()
333 close((*hndl)->netlink_fd); in rmnetctl_init()
334 free(*hndl); in rmnetctl_init()
339 memset(&(*hndl)->dest_addr, 0, sizeof(struct sockaddr_nl)); in rmnetctl_init()
341 (*hndl)->dest_addr.nl_family = AF_NETLINK; in rmnetctl_init()
342 (*hndl)->dest_addr.nl_pid = KERNEL_PROCESS_ID; in rmnetctl_init()
343 (*hndl)->dest_addr.nl_groups = UNICAST; in rmnetctl_init()
350 void rmnetctl_cleanup(rmnetctl_hndl_t *hndl) in rmnetctl_cleanup() argument
352 if (!hndl) in rmnetctl_cleanup()
354 close(hndl->netlink_fd); in rmnetctl_cleanup()
355 free(hndl); in rmnetctl_cleanup()
358 int rmnet_associate_network_device(rmnetctl_hndl_t *hndl, in rmnet_associate_network_device() argument
366 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_associate_network_device()
383 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_associate_network_device()
393 int rmnet_get_network_device_associated(rmnetctl_hndl_t *hndl, in rmnet_get_network_device_associated() argument
400 if ((!hndl) || (!register_status) || (!error_code) || in rmnet_get_network_device_associated()
413 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_network_device_associated()
426 int rmnet_set_link_egress_data_format(rmnetctl_hndl_t *hndl, in rmnet_set_link_egress_data_format() argument
435 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name)) { in rmnet_set_link_egress_data_format()
454 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_link_egress_data_format()
466 int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl, in rmnet_get_link_egress_data_format() argument
475 if ((!hndl) || (!egress_flags) || (!agg_size) || (!agg_count) || in rmnet_get_link_egress_data_format()
489 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_link_egress_data_format()
504 int rmnet_set_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl, in rmnet_set_link_ingress_data_format_tailspace() argument
512 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name)) { in rmnet_set_link_ingress_data_format_tailspace()
529 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_link_ingress_data_format_tailspace()
541 int rmnet_get_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl, in rmnet_get_link_ingress_data_format_tailspace() argument
549 if ((!hndl) || (!error_code) || in rmnet_get_link_ingress_data_format_tailspace()
564 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_link_ingress_data_format_tailspace()
582 int rmnet_set_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_set_logical_ep_config() argument
591 if ((!hndl) || ((ep_id < -1) || (ep_id > 31)) || (!error_code) || in rmnet_set_logical_ep_config()
616 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_logical_ep_config()
627 int rmnet_unset_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_unset_logical_ep_config() argument
635 if ((!hndl) || ((ep_id < -1) || (ep_id > 31)) || (!error_code) || in rmnet_unset_logical_ep_config()
653 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_unset_logical_ep_config()
665 int rmnet_get_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_get_logical_ep_config() argument
674 if ((!hndl) || (!operating_mode) || (!error_code) || ((ep_id < -1) || in rmnet_get_logical_ep_config()
691 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_logical_ep_config()
709 int rmnet_new_vnd_prefix(rmnetctl_hndl_t *hndl, in rmnet_new_vnd_prefix() argument
719 if ((!hndl) || (!error_code) || in rmnet_new_vnd_prefix()
744 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_new_vnd_prefix()
755 int rmnet_new_vnd(rmnetctl_hndl_t *hndl, in rmnet_new_vnd() argument
760 return rmnet_new_vnd_prefix(hndl, id, error_code, new_vnd, 0); in rmnet_new_vnd()
763 int rmnet_get_vnd_name(rmnetctl_hndl_t *hndl, in rmnet_get_vnd_name() argument
773 if ((!hndl) || (!error_code)) { in rmnet_get_vnd_name()
783 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_vnd_name()
802 int rmnet_add_del_vnd_tc_flow(rmnetctl_hndl_t *hndl, in rmnet_add_del_vnd_tc_flow() argument
811 if ((!hndl) || ((set_flow != RMNETCTL_ADD_FLOW) && in rmnet_add_del_vnd_tc_flow()
826 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_add_del_vnd_tc_flow()