/freebsd/contrib/wireguard-tools/ |
H A D | ipc-freebsd.h | 24 struct ifgroupreq ifgr = { .ifgr_name = "wg" }; in kernel_get_wireguard_interfaces() local 31 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) < 0) in kernel_get_wireguard_interfaces() 34 ifgr.ifgr_groups = calloc(1, ifgr.ifgr_len); in kernel_get_wireguard_interfaces() 35 if (!ifgr.ifgr_groups) in kernel_get_wireguard_interfaces() 37 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) < 0) { in kernel_get_wireguard_interfaces() 42 for (ifg = ifgr.ifgr_groups; ifg && ifgr.ifgr_len > 0; ++ifg) { in kernel_get_wireguard_interfaces() 45 ifgr.ifgr_len -= sizeof(struct ifg_req); in kernel_get_wireguard_interfaces() 49 free(ifgr.ifgr_groups); in kernel_get_wireguard_interfaces()
|
/freebsd/lib/libifconfig/ |
H A D | libifconfig.c | 493 struct ifgroupreq *ifgr) in ifconfig_get_groups() argument 497 memset(ifgr, 0, sizeof(*ifgr)); in ifconfig_get_groups() 498 strlcpy(ifgr->ifgr_name, name, IFNAMSIZ); in ifconfig_get_groups() 500 if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFGROUP, ifgr) == -1) { in ifconfig_get_groups() 509 len = ifgr->ifgr_len; in ifconfig_get_groups() 510 ifgr->ifgr_groups = (struct ifg_req *)malloc(len); in ifconfig_get_groups() 511 if (ifgr->ifgr_groups == NULL) { in ifconfig_get_groups() 516 bzero(ifgr->ifgr_groups, len); in ifconfig_get_groups() 517 if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFGROUP, ifgr) == -1) { in ifconfig_get_groups()
|
H A D | libifconfig.h | 192 struct ifgroupreq *ifgr);
|
/freebsd/sbin/ifconfig/ |
H A D | ifconfig.c | 870 struct ifgroupreq ifgr; in group_member() local 881 memset(&ifgr, 0, sizeof(ifgr)); in group_member() 882 strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ); in group_member() 892 if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { in group_member() 900 len = ifgr.ifgr_len; in group_member() 901 ifgr.ifgr_groups = in group_member() 904 if (ifgr.ifgr_groups == NULL) in group_member() 906 if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) in group_member() 912 for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(*ifg); ifg++) { in group_member() 919 free(ifgr.ifgr_groups); in group_member()
|
H A D | ifgroup.c | 48 struct ifgroupreq ifgr = {}; in setifgroup() local 50 strlcpy(ifgr.ifgr_name, ctx->ifname, IFNAMSIZ); in setifgroup() 64 struct ifgroupreq ifgr = {}; in unsetifgroup() local 80 struct ifgroupreq ifgr; in getifgroups() local 88 struct ifg_req *ifg = &ifgr.ifgr_groups[i]; in getifgroups() 100 free(ifgr.ifgr_groups); in getifgroups() 106 struct ifgroupreq ifgr; in printgroup() local 114 bzero(&ifgr, sizeof(ifgr)); in printgroup() 115 strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name)); in printgroup() 124 len = ifgr.ifgr_len; in printgroup() [all …]
|
/freebsd/sbin/pfctl/ |
H A D | pfctl_optimize.c | 1499 struct ifgroupreq ifgr; in interface_group() local 1506 memset(&ifgr, 0, sizeof(ifgr)); in interface_group() 1507 strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ); in interface_group() 1508 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { in interface_group()
|
H A D | pfctl_parser.c | 1379 struct ifgroupreq ifgr; in ifa_add_groups_to_map() local 1385 memset(&ifgr, 0, sizeof(ifgr)); in ifa_add_groups_to_map() 1391 len = ifgr.ifgr_len; in ifa_add_groups_to_map() 1392 ifgr.ifgr_groups = in ifa_add_groups_to_map() 1400 ifg = ifgr.ifgr_groups; in ifa_add_groups_to_map() 1433 free(ifgr.ifgr_groups); in ifa_add_groups_to_map() 1601 struct ifgroupreq ifgr; in ifa_grouplookup() local 1609 bzero(&ifgr, sizeof(ifgr)); in ifa_grouplookup() 1610 strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name)); in ifa_grouplookup() 1611 ifgr.ifgr_len = len; in ifa_grouplookup() [all …]
|
/freebsd/share/examples/libifconfig/ |
H A D | status.c | 349 struct ifgroupreq ifgr; in print_groups() local 354 if (ifconfig_get_groups(lifh, ifa->ifa_name, &ifgr) != 0) { in print_groups() 358 ifg = ifgr.ifgr_groups; in print_groups() 359 len = ifgr.ifgr_len; in print_groups() 374 free(ifgr.ifgr_groups); in print_groups()
|
/freebsd/sys/net/ |
H A D | if.c | 1609 if (ifgr->ifgr_len == 0) { in if_getgroup() 1615 len = ifgr->ifgr_len; in if_getgroup() 1616 ifgp = ifgr->ifgr_groups; in if_getgroup() 1653 if (ifgr->ifgr_len == 0) { in if_getgroupmembers() 1655 ifgr->ifgr_len += sizeof(ifgrq); in if_getgroupmembers() 1660 len = ifgr->ifgr_len; in if_getgroupmembers() 1661 ifgp = ifgr->ifgr_groups; in if_getgroupmembers() 2924 struct ifgroupreq ifgr; in ifioctl() member 2978 sizeof(thunk.ifgr.ifgr_name)); in ifioctl() 2984 sizeof(thunk.ifgr.ifgr_group)); in ifioctl() [all …]
|