Home | History | Annotate | Download | only in src

Lines Matching refs:hndl

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