/freebsd/sbin/ifconfig/ |
H A D | ifgroup.c | 48 struct ifgroupreq ifgr = {}; in setifgroup() local 50 strlcpy(ifgr.ifgr_name, ctx->ifname, IFNAMSIZ); in setifgroup() 55 if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ) in setifgroup() 57 if (ioctl_ctx(ctx, SIOCAIFGROUP, (caddr_t)&ifgr) == -1 && errno != EEXIST) in setifgroup() 64 struct ifgroupreq ifgr = {}; in unsetifgroup() local 66 strlcpy(ifgr.ifgr_name, ctx->ifname, IFNAMSIZ); in unsetifgroup() 71 if (strlcpy(ifgr.ifgr_group, group_name, IFNAMSIZ) >= IFNAMSIZ) in unsetifgroup() 73 if (ioctl_ctx(ctx, SIOCDIFGROUP, (caddr_t)&ifgr) == -1 && errno != ENOENT) in unsetifgroup() 80 struct ifgroupreq ifgr; in getifgroups() local 83 if (ifconfig_get_groups(lifh, ctx->ifname, &ifgr) == -1) in getifgroups() [all …]
|
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()
|
/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/pfctl/ |
H A D | pfctl_parser.c | 1382 struct ifgroupreq ifgr; in ifa_add_groups_to_map() local 1388 memset(&ifgr, 0, sizeof(ifgr)); in ifa_add_groups_to_map() 1389 strlcpy(ifgr.ifgr_name, ifa_name, IFNAMSIZ); in ifa_add_groups_to_map() 1390 if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) in ifa_add_groups_to_map() 1394 len = ifgr.ifgr_len; in ifa_add_groups_to_map() 1395 ifgr.ifgr_groups = in ifa_add_groups_to_map() 1398 if (ifgr.ifgr_groups == NULL) in ifa_add_groups_to_map() 1400 if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) in ifa_add_groups_to_map() 1403 ifg = ifgr.ifgr_groups; in ifa_add_groups_to_map() 1436 free(ifgr.ifgr_groups); in ifa_add_groups_to_map() [all …]
|
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()
|
/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 | 1579 if_getgroup(struct ifgroupreq *ifgr, struct ifnet *ifp) in if_getgroup() argument 1587 if (ifgr->ifgr_len == 0) { in if_getgroup() 1589 ifgr->ifgr_len += sizeof(struct ifg_req); in if_getgroup() 1593 len = ifgr->ifgr_len; in if_getgroup() 1594 ifgp = ifgr->ifgr_groups; in if_getgroup() 1615 if_getgroupmembers(struct ifgroupreq *ifgr) in if_getgroupmembers() argument 1624 if (strcmp(ifg->ifg_group, ifgr->ifgr_name) == 0) in if_getgroupmembers() 1631 if (ifgr->ifgr_len == 0) { in if_getgroupmembers() 1633 ifgr->ifgr_len += sizeof(ifgrq); in if_getgroupmembers() 1638 len = ifgr->ifgr_len; in if_getgroupmembers() [all …]
|