| /freebsd-14.2/sbin/ifconfig/ |
| 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 …]
|
| H A D | ifconfig.c | 879 struct ifgroupreq ifgr; in group_member() local 890 memset(&ifgr, 0, sizeof(ifgr)); in group_member() 891 strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ); in group_member() 901 if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) { in group_member() 909 len = ifgr.ifgr_len; in group_member() 910 ifgr.ifgr_groups = in group_member() 913 if (ifgr.ifgr_groups == NULL) in group_member() 915 if (ioctl(sock, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) in group_member() 921 for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(*ifg); ifg++) { in group_member() 928 free(ifgr.ifgr_groups); in group_member()
|
| /freebsd-14.2/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-14.2/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-14.2/sbin/pfctl/ |
| H A D | pfctl_parser.c | 1372 struct ifgroupreq ifgr; in ifa_add_groups_to_map() local 1378 memset(&ifgr, 0, sizeof(ifgr)); in ifa_add_groups_to_map() 1384 len = ifgr.ifgr_len; in ifa_add_groups_to_map() 1385 ifgr.ifgr_groups = in ifa_add_groups_to_map() 1393 ifg = ifgr.ifgr_groups; in ifa_add_groups_to_map() 1426 free(ifgr.ifgr_groups); in ifa_add_groups_to_map() 1594 struct ifgroupreq ifgr; in ifa_grouplookup() local 1602 bzero(&ifgr, sizeof(ifgr)); in ifa_grouplookup() 1603 strlcpy(ifgr.ifgr_name, ifa_name, sizeof(ifgr.ifgr_name)); in ifa_grouplookup() 1604 ifgr.ifgr_len = len; in ifa_grouplookup() [all …]
|
| H A D | pfctl_optimize.c | 1500 struct ifgroupreq ifgr; in interface_group() local 1507 memset(&ifgr, 0, sizeof(ifgr)); in interface_group() 1508 strlcpy(ifgr.ifgr_name, ifname, IFNAMSIZ); in interface_group() 1509 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { in interface_group()
|
| /freebsd-14.2/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-14.2/sys/net/ |
| H A D | if.c | 1591 if (ifgr->ifgr_len == 0) { in if_getgroup() 1597 len = ifgr->ifgr_len; in if_getgroup() 1598 ifgp = ifgr->ifgr_groups; in if_getgroup() 1635 if (ifgr->ifgr_len == 0) { in if_getgroupmembers() 1637 ifgr->ifgr_len += sizeof(ifgrq); in if_getgroupmembers() 1642 len = ifgr->ifgr_len; in if_getgroupmembers() 1643 ifgp = ifgr->ifgr_groups; in if_getgroupmembers() 2917 struct ifgroupreq ifgr; in ifioctl() member 2971 sizeof(thunk.ifgr.ifgr_name)); in ifioctl() 2977 sizeof(thunk.ifgr.ifgr_group)); in ifioctl() [all …]
|