Lines Matching refs:vaq

66 	varpd_arp_query_t *vaq;  in libvarpd_plugin_proxy_arp()  local
71 vaq = umem_alloc(sizeof (varpd_arp_query_t), UMEM_DEFAULT); in libvarpd_plugin_proxy_arp()
72 if (vaq == NULL) { in libvarpd_plugin_proxy_arp()
76 vaq->vaq_bsize = sizeof (vaq->vaq_buf); in libvarpd_plugin_proxy_arp()
80 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_arp()
90 if (otl->otl_hdrsize + otl->otl_pktsize > vaq->vaq_bsize || in libvarpd_plugin_proxy_arp()
94 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_arp()
98 if (libvarpd_overlay_packet(inst->vri_impl, otl, vaq->vaq_buf, in libvarpd_plugin_proxy_arp()
99 &vaq->vaq_bsize) != 0) { in libvarpd_plugin_proxy_arp()
101 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_arp()
105 if (otl->otl_hdrsize + otl->otl_pktsize < vaq->vaq_bsize) { in libvarpd_plugin_proxy_arp()
107 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_arp()
111 ea = (void *)((uintptr_t)vaq->vaq_buf + (uintptr_t)otl->otl_hdrsize); in libvarpd_plugin_proxy_arp()
122 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_arp()
133 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_arp()
137 bzero(&vaq->vaq_sock, sizeof (struct sockaddr_storage)); in libvarpd_plugin_proxy_arp()
138 ip = (struct sockaddr_in *)&vaq->vaq_sock; in libvarpd_plugin_proxy_arp()
142 vaq->vaq_type = AF_INET; in libvarpd_plugin_proxy_arp()
143 vaq->vaq_inst = inst; in libvarpd_plugin_proxy_arp()
144 vaq->vaq_ea = ea; in libvarpd_plugin_proxy_arp()
145 vaq->vaq_query = vqh; in libvarpd_plugin_proxy_arp()
146 vaq->vaq_otl = otl; in libvarpd_plugin_proxy_arp()
153 (varpd_arp_handle_t *)vaq, VARPD_QTYPE_ETHERNET, in libvarpd_plugin_proxy_arp()
154 (struct sockaddr *)ip, vaq->vaq_lookup); in libvarpd_plugin_proxy_arp()
158 libvarpd_proxy_arp_fini(varpd_arp_query_t *vaq) in libvarpd_proxy_arp_fini() argument
163 ip = (struct sockaddr_in *)&vaq->vaq_sock; in libvarpd_proxy_arp_fini()
168 vaq->vaq_ea->ea_hdr.ar_op = htons(ARPOP_REPLY); in libvarpd_proxy_arp_fini()
169 bcopy(vaq->vaq_ea->arp_sha, vaq->vaq_ea->arp_tha, ETHERADDRL); in libvarpd_proxy_arp_fini()
170 bcopy(vaq->vaq_lookup, vaq->vaq_ea->arp_sha, ETHERADDRL); in libvarpd_proxy_arp_fini()
171 bcopy(vaq->vaq_ea->arp_spa, &ip->sin_addr, in libvarpd_proxy_arp_fini()
172 sizeof (vaq->vaq_ea->arp_spa)); in libvarpd_proxy_arp_fini()
173 bcopy(vaq->vaq_ea->arp_tpa, vaq->vaq_ea->arp_spa, in libvarpd_proxy_arp_fini()
174 sizeof (vaq->vaq_ea->arp_spa)); in libvarpd_proxy_arp_fini()
175 bcopy(&ip->sin_addr, vaq->vaq_ea->arp_tpa, in libvarpd_proxy_arp_fini()
176 sizeof (vaq->vaq_ea->arp_spa)); in libvarpd_proxy_arp_fini()
182 ether = (struct ether_header *)vaq->vaq_buf; in libvarpd_proxy_arp_fini()
184 bcopy(vaq->vaq_lookup, &ether->ether_shost, ETHERADDRL); in libvarpd_proxy_arp_fini()
186 (void) libvarpd_overlay_inject(vaq->vaq_inst->vri_impl, vaq->vaq_otl, in libvarpd_proxy_arp_fini()
187 vaq->vaq_buf, vaq->vaq_bsize); in libvarpd_proxy_arp_fini()
189 libvarpd_plugin_query_reply(vaq->vaq_query, VARPD_LOOKUP_DROP); in libvarpd_proxy_arp_fini()
190 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_proxy_arp_fini()
235 varpd_arp_query_t *vaq; in libvarpd_plugin_proxy_ndp() local
244 vaq = umem_alloc(sizeof (varpd_arp_query_t), UMEM_DEFAULT); in libvarpd_plugin_proxy_ndp()
245 if (vaq == NULL) { in libvarpd_plugin_proxy_ndp()
249 vaq->vaq_bsize = sizeof (vaq->vaq_buf); in libvarpd_plugin_proxy_ndp()
254 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
263 if (otl->otl_hdrsize + otl->otl_pktsize > vaq->vaq_bsize) { in libvarpd_plugin_proxy_ndp()
265 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
272 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
276 if (libvarpd_overlay_packet(inst->vri_impl, otl, vaq->vaq_buf, in libvarpd_plugin_proxy_ndp()
277 &vaq->vaq_bsize) != 0) { in libvarpd_plugin_proxy_ndp()
279 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
283 bsize = vaq->vaq_bsize; in libvarpd_plugin_proxy_ndp()
287 v6hdr = (ip6_t *)(vaq->vaq_buf + otl->otl_hdrsize); in libvarpd_plugin_proxy_ndp()
290 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
296 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
310 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
318 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
332 ns = (nd_neighbor_solicit_t *)(vaq->vaq_buf + otl->otl_hdrsize + in libvarpd_plugin_proxy_ndp()
336 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
344 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
354 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
369 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_proxy_ndp()
373 bzero(&vaq->vaq_sock, sizeof (struct sockaddr_storage)); in libvarpd_plugin_proxy_ndp()
374 s6 = (struct sockaddr_in6 *)&vaq->vaq_sock; in libvarpd_plugin_proxy_ndp()
382 vaq->vaq_type = AF_INET6; in libvarpd_plugin_proxy_ndp()
383 vaq->vaq_inst = inst; in libvarpd_plugin_proxy_ndp()
384 vaq->vaq_ea = NULL; in libvarpd_plugin_proxy_ndp()
385 vaq->vaq_query = vqh; in libvarpd_plugin_proxy_ndp()
386 vaq->vaq_otl = otl; in libvarpd_plugin_proxy_ndp()
387 vaq->vaq_ns = ns; in libvarpd_plugin_proxy_ndp()
388 vaq->vaq_ip6 = v6hdr; in libvarpd_plugin_proxy_ndp()
390 (varpd_arp_handle_t *)vaq, VARPD_QTYPE_ETHERNET, in libvarpd_plugin_proxy_ndp()
391 (struct sockaddr *)s6, vaq->vaq_lookup); in libvarpd_plugin_proxy_ndp()
395 libvarpd_proxy_ndp_fini(varpd_arp_query_t *vaq) in libvarpd_proxy_ndp_fini() argument
408 v6hdr = vaq->vaq_ip6; in libvarpd_proxy_ndp_fini()
409 bcopy(vaq->vaq_buf, resp, vaq->vaq_otl->otl_hdrsize); in libvarpd_proxy_ndp_fini()
412 bcopy(vaq->vaq_lookup, &ether->ether_shost, ETHERADDRL); in libvarpd_proxy_ndp_fini()
413 roff += vaq->vaq_otl->otl_hdrsize; in libvarpd_proxy_ndp_fini()
417 bcopy(&vaq->vaq_ns->nd_ns_target, &v6hdr->ip6_src, in libvarpd_proxy_ndp_fini()
433 bcopy(&vaq->vaq_ns->nd_ns_target, &na->nd_na_target, in libvarpd_proxy_ndp_fini()
441 bcopy(vaq->vaq_lookup, resp + roff, ETHERADDRL); in libvarpd_proxy_ndp_fini()
449 vaq->vaq_otl->otl_hdrsize); in libvarpd_proxy_ndp_fini()
453 (void) libvarpd_overlay_inject(vaq->vaq_inst->vri_impl, vaq->vaq_otl, in libvarpd_proxy_ndp_fini()
456 libvarpd_plugin_query_reply(vaq->vaq_query, VARPD_LOOKUP_DROP); in libvarpd_proxy_ndp_fini()
457 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_proxy_ndp_fini()
463 varpd_arp_query_t *vaq = (varpd_arp_query_t *)vah; in libvarpd_plugin_arp_reply() local
465 if (vaq == NULL) in libvarpd_plugin_arp_reply()
470 libvarpd_plugin_query_reply(vaq->vaq_query, VARPD_LOOKUP_DROP); in libvarpd_plugin_arp_reply()
471 umem_free(vaq, sizeof (varpd_arp_query_t)); in libvarpd_plugin_arp_reply()
475 vaq->vaq_inst->vri_plugin->vpp_name, action); in libvarpd_plugin_arp_reply()
477 switch (vaq->vaq_type) { in libvarpd_plugin_arp_reply()
479 libvarpd_proxy_arp_fini(vaq); in libvarpd_plugin_arp_reply()
482 libvarpd_proxy_ndp_fini(vaq); in libvarpd_plugin_arp_reply()
486 vaq->vaq_type); in libvarpd_plugin_arp_reply()