Lines Matching defs:afm

72 static struct afm *afm_match4(struct afm_head *, struct flowinfo_in *);
74 static struct afm *afm_match6(struct afm_head *, struct flowinfo_in6 *);
118 struct afm *
133 struct afm *afm;
149 afm = malloc(sizeof(struct afm), M_DEVBUF, M_WAITOK|M_ZERO);
150 if (afm == NULL)
153 afm->afm_vci = flowmap->af_vci;
154 afm->afm_vpi = flowmap->af_vpi;
155 (void)memcpy(&afm->afm_flowinfo, &flowmap->af_flowinfo,
158 LIST_INSERT_HEAD(&head->afh_head, afm, afm_list);
163 afm_remove(struct afm *afm)
165 LIST_REMOVE(afm, afm_list);
166 free(afm, M_DEVBUF);
174 struct afm *afm;
179 while ((afm = head->afh_head.lh_first) != NULL)
180 afm_remove(afm);
184 struct afm *
188 struct afm *afm;
193 for (afm = head->afh_head.lh_first; afm != NULL;
194 afm = afm->afm_list.le_next)
195 if (afm->afm_vpi == vpi && afm->afm_vci == vci)
197 return afm;
200 static struct afm *
203 struct afm *afm;
205 for (afm = head->afh_head.lh_first; afm != NULL;
206 afm = afm->afm_list.le_next) {
207 if (afm->afm_flowinfo4.fi_dst.s_addr != 0 &&
208 afm->afm_flowinfo4.fi_dst.s_addr != fp->fi_dst.s_addr)
210 if (afm->afm_flowinfo4.fi_dport != 0 &&
211 afm->afm_flowinfo4.fi_dport != fp->fi_dport)
213 if (afm->afm_flowinfo4.fi_src.s_addr != 0 &&
214 afm->afm_flowinfo4.fi_src.s_addr != fp->fi_src.s_addr)
216 if (afm->afm_flowinfo4.fi_sport != 0 &&
217 afm->afm_flowinfo4.fi_sport != fp->fi_sport)
219 if (afm->afm_flowinfo4.fi_proto != 0 &&
220 afm->afm_flowinfo4.fi_proto != fp->fi_proto)
223 return afm;
229 static struct afm *
232 struct afm *afm;
234 for (afm = head->afh_head.lh_first; afm != NULL;
235 afm = afm->afm_list.le_next) {
236 if (afm->afm_flowinfo6.fi6_flowlabel != 0 &&
237 afm->afm_flowinfo6.fi6_flowlabel != fp->fi6_flowlabel)
240 if (!IN6_IS_ADDR_UNSPECIFIED(&afm->afm_flowinfo6.fi6_dst) &&
241 !IN6_ARE_ADDR_EQUAL(&afm->afm_flowinfo6.fi6_dst,
244 if (afm->afm_flowinfo6.fi6_dport != 0 &&
245 afm->afm_flowinfo6.fi6_dport != fp->fi6_dport)
248 if (!IN6_IS_ADDR_UNSPECIFIED(&afm->afm_flowinfo6.fi6_src) &&
249 !IN6_ARE_ADDR_EQUAL(&afm->afm_flowinfo6.fi6_src,
253 if (afm->afm_flowinfo6.fi6_sport != 0 &&
254 afm->afm_flowinfo6.fi6_sport != fp->fi6_sport)
257 if (afm->afm_flowinfo6.fi6_proto != 0 &&
258 afm->afm_flowinfo6.fi6_proto != fp->fi6_proto)
261 return (afm);
268 struct afm *
303 * afm device interface
305 altqdev_decl(afm);