Lines Matching refs:ifgr
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()
87 for (size_t i = 0; i < ifgr.ifgr_len / sizeof(struct ifg_req); ++i) { in getifgroups()
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()
116 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) { in printgroup()
124 len = ifgr.ifgr_len; in printgroup()
125 if ((ifgr.ifgr_groups = calloc(1, len)) == NULL) in printgroup()
127 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) in printgroup()
130 for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(struct ifg_req); in printgroup()
135 free(ifgr.ifgr_groups); in printgroup()