Lines Matching defs:ifp
206 if_init(struct interface *ifp)
218 snprintf(path, sizeof(path), PROC_PROMOTE, ifp->name);
228 if_conf(struct interface *ifp)
234 snprintf(path, sizeof(path), SYS_LAYER2, ifp->name);
239 ifp->options->options |= DHCPCD_BROADCAST;
321 get_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp, int fd, int flags,
381 r = callback(ctx, ifp, nlm);
523 link_route(struct dhcpcd_ctx *ctx, __unused struct interface *ifp,
579 link_addr(struct dhcpcd_ctx *ctx, struct interface *ifp, struct nlmsghdr *nlm)
600 if ((ifp = if_findindex(ctx->ifaces, ifa->ifa_index)) == NULL) {
616 if (ifp->flags & IFF_POINTOPOINT) {
628 ipv4_handleifa(ctx, nlm->nlmsg_type, NULL, ifp->name,
644 ipv6_handleifa(ctx, nlm->nlmsg_type, NULL, ifp->name,
674 struct interface *ifp;
676 TAILQ_FOREACH(ifp, ctx->ifaces, next) {
677 if (ifp->index == ifindex && strcmp(ifp->name, ifname)) {
678 dhcpcd_handleinterface(ctx, -1, ifp->name);
690 link_neigh(struct dhcpcd_ctx *ctx, __unused struct interface *ifp,
734 link_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp,
743 r = link_route(ctx, ifp, nlm);
746 r = link_addr(ctx, ifp, nlm);
750 r = link_neigh(ctx, ifp, nlm);
807 if ((ifp = if_find(ctx->ifaces, ifn)) == NULL) {
839 send_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp,
865 r = get_netlink(ctx, ifp, s, 0, callback);
1010 _gnl_getfamily(__unused struct dhcpcd_ctx *ctx, __unused struct interface *ifp,
1045 _if_getssid(__unused struct dhcpcd_ctx *ctx, struct interface *ifp,
1056 ifp->ssid_len = 0;
1060 ifp->ssid_len = NLA_LEN(tb[NL80211_ATTR_SSID]);
1061 if (ifp->ssid_len > sizeof(ifp->ssid)) {
1063 ifp->ssid_len = 0;
1066 memcpy(ifp->ssid, NLA_DATA(tb[NL80211_ATTR_SSID]), ifp->ssid_len);
1069 ifp->ssid[ifp->ssid_len] = '\0';
1070 return (int)ifp->ssid_len;
1074 if_getssid_nl80211(struct interface *ifp)
1080 family = gnl_getfamily(ifp->ctx, "nl80211");
1088 nla_put_32(&nlm.hdr, sizeof(nlm), NL80211_ATTR_IFINDEX, ifp->index);
1090 return send_netlink(ifp->ctx, ifp,
1096 if_getssid(struct interface *ifp)
1100 r = if_getssid_wext(ifp->name, ifp->ssid);
1102 ifp->ssid_len = (unsigned int)r;
1105 r = if_getssid_nl80211(ifp);
1128 if_openrawsocket(struct interface *ifp, uint16_t protocol)
1185 su.sll.sll_ifindex = (int)ifp->index;
1196 if_sendrawpacket(const struct interface *ifp, uint16_t protocol,
1210 su.sll.sll_ifindex = (int)ifp->index;
1211 su.sll.sll_hatype = htons(ifp->family);
1212 su.sll.sll_halen = (unsigned char)ifp->hwlen;
1213 if (ifp->family == ARPHRD_INFINIBAND)
1218 memcpy(&su.sll.sll_addr, dest_hw_addr, ifp->hwlen);
1220 memset(&su.sll.sll_addr, 0xff, ifp->hwlen);
1222 state = D_CSTATE(ifp);
1232 if_readrawpacket(struct interface *ifp, uint16_t protocol,
1258 state = D_STATE(ifp);
1391 _if_initrt(struct dhcpcd_ctx *ctx, __unused struct interface *ifp,
1402 if_initrt(struct interface *ifp)
1406 ipv4_freerts(ifp->ctx->ipv4_kroutes);
1415 add_attr_32(&nlm.hdr, sizeof(nlm), RTA_OIF, ifp->index);
1417 return send_netlink(ifp->ctx, ifp,
1423 __unused const struct interface *ifp)
1593 _if_initrt6(struct dhcpcd_ctx *ctx, __unused struct interface *ifp,
1604 if_initrt6(struct interface *ifp)
1608 ipv6_freerts(&ifp->ctx->ipv6->kroutes);
1617 add_attr_32(&nlm.hdr, sizeof(nlm), RTA_OIF, ifp->index);
1619 return send_netlink(ifp->ctx, ifp,
1624 if_addrflags6(const struct in6_addr *addr, const struct interface *ifp)
1649 if (strcmp(name, ifp->name) == 0 &&
1728 if_checkipv6(struct dhcpcd_ctx *ctx, const struct interface *ifp, int own)
1734 if (ifp == NULL)
1737 if (if_disable_autolinklocal(ctx, (int)ifp->index) == -1)
1739 "%s: if_disable_autolinklocal: %m", ifp->name);
1741 if (ifp)
1742 ifname = ifp->name;