Lines Matching refs:hndl

103 static uint16_t rmnetctl_transact(rmnetctl_hndl_t *hndl,  in rmnetctl_transact()  argument
117 if (!hndl){ in rmnetctl_transact()
147 nlmsghdr_val->nlmsg_seq = hndl->transaction_id; in rmnetctl_transact()
148 nlmsghdr_val->nlmsg_pid = hndl->pid; in rmnetctl_transact()
155 hndl->transaction_id++; in rmnetctl_transact()
157 saddr_ptr = &hndl->dest_addr; in rmnetctl_transact()
159 if (sendto(hndl->netlink_fd, in rmnetctl_transact()
171 saddr_ptr = &hndl->src_addr; in rmnetctl_transact()
172 bytes_read = recvfrom(hndl->netlink_fd, in rmnetctl_transact()
311 int rmnetctl_init(rmnetctl_hndl_t **hndl, uint16_t *error_code) in rmnetctl_init() argument
317 if ((!hndl) || (!error_code)){ in rmnetctl_init()
322 *hndl = (rmnetctl_hndl_t *)malloc(sizeof(rmnetctl_hndl_t)); in rmnetctl_init()
323 if (!*hndl) { in rmnetctl_init()
328 memset(*hndl, 0, sizeof(rmnetctl_hndl_t)); in rmnetctl_init()
332 free(*hndl); in rmnetctl_init()
336 (*hndl)->pid = (uint32_t)pid; in rmnetctl_init()
339 free(*hndl); in rmnetctl_init()
344 (*hndl)->netlink_fd = netlink_fd; in rmnetctl_init()
346 memset(&(*hndl)->src_addr, 0, sizeof(struct sockaddr_nl)); in rmnetctl_init()
348 (*hndl)->src_addr.nl_family = AF_NETLINK; in rmnetctl_init()
349 (*hndl)->src_addr.nl_pid = (*hndl)->pid; in rmnetctl_init()
351 saddr_ptr = &(*hndl)->src_addr; in rmnetctl_init()
352 if (bind((*hndl)->netlink_fd, in rmnetctl_init()
355 close((*hndl)->netlink_fd); in rmnetctl_init()
356 free(*hndl); in rmnetctl_init()
361 memset(&(*hndl)->dest_addr, 0, sizeof(struct sockaddr_nl)); in rmnetctl_init()
363 (*hndl)->dest_addr.nl_family = AF_NETLINK; in rmnetctl_init()
364 (*hndl)->dest_addr.nl_pid = KERNEL_PROCESS_ID; in rmnetctl_init()
365 (*hndl)->dest_addr.nl_groups = UNICAST; in rmnetctl_init()
372 void rmnetctl_cleanup(rmnetctl_hndl_t *hndl) in rmnetctl_cleanup() argument
374 if (!hndl) in rmnetctl_cleanup()
376 close(hndl->netlink_fd); in rmnetctl_cleanup()
377 free(hndl); in rmnetctl_cleanup()
380 int rmnet_associate_network_device(rmnetctl_hndl_t *hndl, in rmnet_associate_network_device() argument
389 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_associate_network_device()
406 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_associate_network_device()
416 int rmnet_get_network_device_associated(rmnetctl_hndl_t *hndl, in rmnet_get_network_device_associated() argument
424 if ((!hndl) || (!register_status) || (!error_code) || in rmnet_get_network_device_associated()
437 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_network_device_associated()
450 int rmnet_set_link_egress_data_format(rmnetctl_hndl_t *hndl, in rmnet_set_link_egress_data_format() argument
460 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_set_link_egress_data_format()
480 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_link_egress_data_format()
492 int rmnet_get_link_egress_data_format(rmnetctl_hndl_t *hndl, in rmnet_get_link_egress_data_format() argument
502 if ((!hndl) || (!egress_flags) || (!agg_size) || (!agg_count) || in rmnet_get_link_egress_data_format()
516 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_link_egress_data_format()
531 int rmnet_set_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl, in rmnet_set_link_ingress_data_format_tailspace() argument
540 if ((!hndl) || (!error_code) || _rmnetctl_check_dev_name(dev_name) || in rmnet_set_link_ingress_data_format_tailspace()
558 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_link_ingress_data_format_tailspace()
570 int rmnet_get_link_ingress_data_format_tailspace(rmnetctl_hndl_t *hndl, in rmnet_get_link_ingress_data_format_tailspace() argument
579 if ((!hndl) || (!error_code) || in rmnet_get_link_ingress_data_format_tailspace()
594 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_link_ingress_data_format_tailspace()
612 int rmnet_set_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_set_logical_ep_config() argument
622 if ((!hndl) || ((ep_id < -1) || (ep_id > 31)) || (!error_code) || in rmnet_set_logical_ep_config()
648 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_set_logical_ep_config()
659 int rmnet_unset_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_unset_logical_ep_config() argument
668 if ((!hndl) || ((ep_id < -1) || (ep_id > 31)) || (!error_code) || in rmnet_unset_logical_ep_config()
686 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_unset_logical_ep_config()
698 int rmnet_get_logical_ep_config(rmnetctl_hndl_t *hndl, in rmnet_get_logical_ep_config() argument
709 if ((!hndl) || (!operating_mode) || (!error_code) || ((ep_id < -1) || in rmnet_get_logical_ep_config()
727 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_logical_ep_config()
745 int rmnet_new_vnd_prefix(rmnetctl_hndl_t *hndl, in rmnet_new_vnd_prefix() argument
755 if ((!hndl) || (!error_code) || in rmnet_new_vnd_prefix()
780 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_new_vnd_prefix()
791 int rmnet_new_vnd(rmnetctl_hndl_t *hndl, in rmnet_new_vnd() argument
796 return rmnet_new_vnd_prefix(hndl, id, error_code, new_vnd, 0); in rmnet_new_vnd()
799 int rmnet_get_vnd_name(rmnetctl_hndl_t *hndl, in rmnet_get_vnd_name() argument
809 if ((!hndl) || (!error_code) || (!buf) || (0 == buflen)) { in rmnet_get_vnd_name()
819 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_get_vnd_name()
838 int rmnet_add_del_vnd_tc_flow(rmnetctl_hndl_t *hndl, in rmnet_add_del_vnd_tc_flow() argument
847 if ((!hndl) || (!error_code) || ((set_flow != RMNETCTL_ADD_FLOW) && in rmnet_add_del_vnd_tc_flow()
862 if ((*error_code = rmnetctl_transact(hndl, &request, &response)) in rmnet_add_del_vnd_tc_flow()