Lines Matching defs:ifp
72 ifnet_t ifp)
74 ifnet_detached_func detach_func = ifp->if_kpi_storage;
77 detach_func(ifp);
79 if (ifp->if_broadcast.length > sizeof(ifp->if_broadcast.u.buffer)) {
80 FREE(ifp->if_broadcast.u.ptr, M_IFADDR);
81 ifp->if_broadcast.u.ptr = NULL;
84 dlil_if_release(ifp);
104 struct ifnet *ifp = NULL;
116 error = dlil_if_acquire(init->family, init->uniqueid, init->uniqueid_len, &ifp);
120 * Cast ifp->if_name as non const. dlil_if_acquire sets it up
124 strncpy(_cast_non_const(ifp->if_name), init->name, IFNAMSIZ);
125 ifp->if_type = init->type;
126 ifp->if_family = init->family;
127 ifp->if_unit = init->unit;
128 ifp->if_output = init->output;
129 ifp->if_demux = init->demux;
130 ifp->if_add_proto = init->add_proto;
131 ifp->if_del_proto = init->del_proto;
132 ifp->if_check_multi = init->check_multi;
133 ifp->if_framer = init->framer;
134 ifp->if_softc = init->softc;
135 ifp->if_ioctl = init->ioctl;
136 ifp->if_set_bpf_tap = init->set_bpf_tap;
137 ifp->if_free = ifnet_kpi_free;
138 ifp->if_event = init->event;
139 ifp->if_kpi_storage = init->detach;
140 ifp->if_eflags |= IFEF_USEKPI;
143 if (init->broadcast_len > sizeof(ifp->if_broadcast.u.buffer)) {
144 MALLOC(ifp->if_broadcast.u.ptr, u_char*, init->broadcast_len, M_IFADDR, M_NOWAIT);
145 if (ifp->if_broadcast.u.ptr == NULL) {
149 bcopy(init->broadcast_addr, ifp->if_broadcast.u.ptr, init->broadcast_len);
153 bcopy(init->broadcast_addr, ifp->if_broadcast.u.buffer, init->broadcast_len);
155 ifp->if_broadcast.length = init->broadcast_len;
158 bzero(&ifp->if_broadcast, sizeof(ifp->if_broadcast));
162 *interface = ifp;
163 ifnet_reference(ifp); // temporary - this should be done in dlil_if_acquire
166 dlil_if_release(ifp);
186 ifnet_t ifp)
190 if (ifp == NULL) return EINVAL;
192 oldval = OSIncrementAtomic((SInt32 *)&ifp->if_refcnt);
199 ifnet_t ifp)
203 if (ifp == NULL) return EINVAL;
205 oldval = OSDecrementAtomic((SInt32*)&ifp->if_refcnt);
761 struct ifnet *ifp;
769 TAILQ_FOREACH(ifp, &ifnet, if_link)
771 if (interface && ifp != interface) continue;
773 ifnet_lock_shared(ifp);
774 if ((ifp->if_eflags & IFEF_DETACHING) == 0) {
775 if (interface == NULL || interface == ifp)
778 TAILQ_FOREACH(addr, &ifp->if_addrhead, ifa_link)
786 ifnet_lock_done(ifp);
790 ifnet_lock_done(ifp);
799 TAILQ_FOREACH(ifp, &ifnet, if_link)
801 if (interface && ifp != interface) continue;
803 ifnet_lock_shared(ifp);
804 if ((ifp->if_eflags & IFEF_DETACHING) == 0) {
805 if (interface == NULL || (struct ifnet*)interface == ifp)
808 TAILQ_FOREACH(addr, &ifp->if_addrhead, ifa_link)
819 ifnet_lock_done(ifp);
1053 struct ifnet *ifp;
1063 TAILQ_FOREACH(ifp, &ifnet, if_link)
1065 struct ifaddr *ifa = ifnet_addrs[ifp->if_index - 1];
1073 if ((ifp->if_eflags & IFEF_DETACHING) == 0 &&
1080 if (ifp) {
1081 *interface = ifp;
1086 return (ifp == NULL) ? ENXIO : 0;
1105 struct ifnet *ifp;
1114 TAILQ_FOREACH(ifp, &ifnet, if_link) {
1115 if ((ifp->if_eflags & IFEF_DETACHING) && !get_all)
1117 if (family == IFNET_FAMILY_ANY || ifp->if_family == family)
1132 TAILQ_FOREACH(ifp, &ifnet, if_link) {
1133 if ((ifp->if_eflags & IFEF_DETACHING) && !get_all)
1138 ((ifnet_family_t)ifp->if_family) == family) {
1139 (*list)[*count] = (ifnet_t)ifp;
1257 struct ifnet *ifp;
1259 ifp = ifa->ifa_ifp;
1261 return (ifnet_t)ifp;