Home | History | Annotate | Download | only in mDNSPosix

Lines Matching defs:ifi

85 		struct ifi_info *ifi, *ifihead, **ifipnext, *ifipold, **ifiptr;
121 ifi = (struct ifi_info*)calloc(1, sizeof(struct ifi_info));
122 if (ifi == NULL) {
128 *ifipnext = ifi; /* prev points to this new one */
129 ifipnext = &ifi->ifi_next; /* pointer to next one goes here */
143 ifi->ifi_addr = calloc(1, sizeof(struct sockaddr_in6));
144 if (ifi->ifi_addr == NULL) {
147 memcpy(ifi->ifi_addr, res0->ai_addr, sizeof(struct sockaddr_in6));
152 ifi->ifi_netmask = calloc(1, sizeof(struct sockaddr_in6));
153 if (ifi->ifi_addr == NULL) {
162 memcpy(ifi->ifi_netmask, sin6, sizeof(struct sockaddr_in6));
167 strncpy(ifi->ifi_name, ifname, IFI_NAME);
170 ifi->ifi_index = index;
181 free(ifi->ifi_addr);
182 free(ifi);
190 ifi->ifi_flags = ifr.ifr_flags;
224 struct ifi_info *ifi, *ifihead, **ifipnext, *ifipold, **ifiptr;
312 ifi = (struct ifi_info*)calloc(1, sizeof(struct ifi_info));
313 if (ifi == NULL) {
318 *ifipnext = ifi; /* prev points to this new one */
319 ifipnext = &ifi->ifi_next; /* pointer to next one goes here */
321 ifi->ifi_flags = flags; /* IFF_xxx values */
322 ifi->ifi_myflags = myflags; /* IFI_xxx values */
324 ifi->ifi_index = if_nametoindex(ifr->ifr_name);
329 ifi->ifi_index = ifrcopy.ifr_index;
332 ifi->ifi_index = index++; /* SIOCGIFINDEX is broken on Solaris 2.5ish, so fake it */
334 memcpy(ifi->ifi_name, ifr->ifr_name, IFI_NAME);
335 ifi->ifi_name[IFI_NAME-1] = '\0';
341 if (ifi->ifi_addr == NULL) {
342 ifi->ifi_addr = (struct sockaddr*)calloc(1, sizeof(struct sockaddr_in));
343 if (ifi->ifi_addr == NULL) {
346 memcpy(ifi->ifi_addr, sinptr, sizeof(struct sockaddr_in));
356 free(ifi->ifi_addr);
357 free(ifi);
366 ifi->ifi_netmask = (struct sockaddr*)calloc(1, sizeof(struct sockaddr_in));
367 if (ifi->ifi_netmask == NULL) goto gotError;
374 memcpy(ifi->ifi_netmask, sinptr, sizeof(struct sockaddr_in));
388 ifi->ifi_brdaddr = (struct sockaddr*)calloc(1, sizeof(struct sockaddr_in));
389 if (ifi->ifi_brdaddr == NULL) {
392 memcpy(ifi->ifi_brdaddr, sinptr, sizeof(struct sockaddr_in));
407 ifi->ifi_dstaddr = (struct sockaddr*)calloc(1, sizeof(struct sockaddr_in));
408 if (ifi->ifi_dstaddr == NULL) {
411 memcpy(ifi->ifi_dstaddr, sinptr, sizeof(struct sockaddr_in));
420 if (ifi->ifi_addr == NULL) {
421 ifi->ifi_addr = calloc(1, sizeof(struct sockaddr_in6));
422 if (ifi->ifi_addr == NULL) {
430 memcpy(ifi->ifi_addr, sinptr6, sizeof(struct sockaddr_in6));
447 free(ifi->ifi_addr);
448 free(ifi);
456 ifi->ifi_netmask = (struct sockaddr*)calloc(1, sizeof(struct sockaddr_in6));
457 if (ifi->ifi_netmask == NULL) goto gotError;
459 memcpy(ifi->ifi_netmask, sinptr6, sizeof(struct sockaddr_in6));
498 struct ifi_info *ifi, *ifinext;
500 for (ifi = ifihead; ifi != NULL; ifi = ifinext) {
501 if (ifi->ifi_addr != NULL)
502 free(ifi->ifi_addr);
503 if (ifi->ifi_netmask != NULL)
504 free(ifi->ifi_netmask);
505 if (ifi->ifi_brdaddr != NULL)
506 free(ifi->ifi_brdaddr);
507 if (ifi->ifi_dstaddr != NULL)
508 free(ifi->ifi_dstaddr);
509 ifinext = ifi->ifi_next; /* can't fetch ifi_next after free() */
510 free(ifi); /* the ifi_info{} itself */