Lines Matching refs:ifa
39 struct ifaddrs *ifa; in get_interface() local
51 ifa = malloc(sizeof(struct ifaddrs)); in get_interface()
52 if (!ifa) in get_interface()
54 memset(ifa, 0, sizeof(struct ifaddrs)); in get_interface()
56 ifa->ifa_name = malloc(strlen(name)+1); in get_interface()
57 if (!ifa->ifa_name) { in get_interface()
58 free(ifa); in get_interface()
61 strcpy(ifa->ifa_name, name); in get_interface()
62 ifa->ifa_flags = flags; in get_interface()
70 ifa->ifa_addr = (struct sockaddr *)saddr; in get_interface()
79 ifa->ifa_netmask = (struct sockaddr *)smask; in get_interface()
87 ifc_get_ifindex(ifa->ifa_name, &hwaddr->sll_ifindex); in get_interface()
93 ifa->ifa_addr = (struct sockaddr *)hwaddr; in get_interface()
94 ifa->ifa_netmask = (struct sockaddr *)smask; in get_interface()
96 return ifa; in get_interface()
103 struct ifaddrs *ifa; in getifaddrs() local
119 ifa = get_interface(de->d_name, AF_INET); in getifaddrs()
120 if (ifa != NULL) { in getifaddrs()
121 ifa->ifa_next = ifah; in getifaddrs()
122 ifah = ifa; in getifaddrs()
124 ifa = get_interface(de->d_name, AF_PACKET); in getifaddrs()
125 if (ifa != NULL) { in getifaddrs()
126 ifa->ifa_next = ifah; in getifaddrs()
127 ifah = ifa; in getifaddrs()
136 void freeifaddrs(struct ifaddrs *ifa) in freeifaddrs() argument
140 while (ifa) { in freeifaddrs()
141 ifp = ifa; in freeifaddrs()
147 ifa = ifa->ifa_next; in freeifaddrs()