Lines Matching refs:netid
100 static size_t dhcp_packet_size(struct dhcp_packet* mess, struct dhcp_netid* netid,
105 char* domain, char* config_domain, struct dhcp_netid* netid,
113 static int prune_vendor_opts(struct dhcp_netid* netid);
114 static struct dhcp_opt* pxe_opts(int pxe_arch, struct dhcp_netid* netid);
115 struct dhcp_boot* find_boot(struct dhcp_netid* netid);
134 struct dhcp_netid* netid; in dhcp_reply() local
151 netid = &iface_id; in dhcp_reply()
228 vendor->netid.next = netid; in dhcp_reply()
229 netid = &vendor->netid; in dhcp_reply()
263 mac->netid.next = netid; in dhcp_reply()
264 netid = &mac->netid; in dhcp_reply()
342 known_id.next = netid; in dhcp_reply()
343 netid = &known_id; in dhcp_reply()
364 config->netid.next = netid; in dhcp_reply()
365 netid = &config->netid; in dhcp_reply()
373 id.next = netid; in dhcp_reply()
374 netid = &id; in dhcp_reply()
380 bootp_id.next = netid; in dhcp_reply()
381 netid = &bootp_id; in dhcp_reply()
384 if (match_netid(id_list->list, netid, 0)) message = _("ignored"); in dhcp_reply()
399 !address_available(context, lease->addr, netid)) { in dhcp_reply()
405 if (!address_allocate(context, &mess->yiaddr, mess->chaddr, mess->hlen, netid, in dhcp_reply()
412 if (!message && !(context = narrow_context(context, mess->yiaddr, netid))) in dhcp_reply()
414 else if (context->netid.net) { in dhcp_reply()
415 context->netid.next = netid; in dhcp_reply()
416 netid = &context->netid; in dhcp_reply()
421 if ((!id_list->list) || match_netid(id_list->list, netid, 0)) break; in dhcp_reply()
440 netid, subnet_addr, 0, 0, 0, NULL); in dhcp_reply()
446 return message ? 0 : dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
524 known_id.next = netid; in dhcp_reply()
525 netid = &known_id; in dhcp_reply()
532 config->netid.next = netid; in dhcp_reply()
533 netid = &config->netid; in dhcp_reply()
562 o->netid->next = netid; in dhcp_reply()
563 netid = o->netid; in dhcp_reply()
604 vendor->netid.next = netid; in dhcp_reply()
605 netid = &vendor->netid; in dhcp_reply()
625 if (match_netid(id_list->list, netid, 0)) ignore = 1; in dhcp_reply()
677 prune_vendor_opts(netid); in dhcp_reply()
682 opt71.netid = NULL; in dhcp_reply()
688 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
697 struct dhcp_boot* boot = find_boot(netid); in dhcp_reply()
720 prune_vendor_opts(netid); in dhcp_reply()
721 do_encap_opts(pxe_opts(pxearch, netid), OPTION_VENDOR_CLASS_OPT, DHOPT_VENDOR_MATCH, in dhcp_reply()
726 return ignore ? 0 : dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
769 if (!(context = narrow_context(context, mess->ciaddr, netid)) || in dhcp_reply()
829 else if (lease && address_available(context, lease->addr, netid) && in dhcp_reply()
832 else if (opt && address_available(context, addr, netid) && in dhcp_reply()
838 else if (!address_allocate(context, &mess->yiaddr, emac, emac_len, netid, now)) in dhcp_reply()
845 if (message || !(context = narrow_context(context, mess->yiaddr, netid))) return 0; in dhcp_reply()
849 if (context->netid.net) { in dhcp_reply()
850 context->netid.next = netid; in dhcp_reply()
851 netid = &context->netid; in dhcp_reply()
866 domain, netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid); in dhcp_reply()
868 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
941 if (!(context = narrow_context(context, mess->yiaddr, netid))) { in dhcp_reply()
949 else if (!address_available(context, mess->yiaddr, netid) && in dhcp_reply()
1057 if (context->netid.net) { in dhcp_reply()
1058 context->netid.next = netid; in dhcp_reply()
1059 netid = &context->netid; in dhcp_reply()
1068 if ((!id_list->list) || match_netid(id_list->list, netid, 0)) break; in dhcp_reply()
1095 domain, netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid); in dhcp_reply()
1098 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
1108 context = narrow_context(context, mess->ciaddr, netid); in dhcp_reply()
1119 if (context && context->netid.net) { in dhcp_reply()
1120 context->netid.next = netid; in dhcp_reply()
1121 netid = &context->netid; in dhcp_reply()
1146 netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid); in dhcp_reply()
1149 return dhcp_packet_size(mess, netid, agent_id, real_end); in dhcp_reply()
1356 static size_t dhcp_packet_size(struct dhcp_packet* mess, struct dhcp_netid* netid, in dhcp_packet_size() argument
1372 if (netid && (daemon->options & OPT_LOG_OPTS)) { in dhcp_packet_size()
1374 for (*s = 0; netid; netid = netid->next) { in dhcp_packet_size()
1376 for (n = netid->next; n; n = n->next) in dhcp_packet_size()
1377 if (strcmp(netid->net, n->net) == 0) break; in dhcp_packet_size()
1380 strncat(s, netid->net, (MAXDNAME - 1) - strlen(s)); in dhcp_packet_size()
1381 if (netid->next) strncat(s, ", ", (MAXDNAME - 1) - strlen(s)); in dhcp_packet_size()
1415 if (match_netid(id_list->list, netid, 0)) in dhcp_packet_size()
1532 static struct dhcp_opt* option_find2(struct dhcp_netid* netid, struct dhcp_opt* opts, int opt) { in option_find2() argument
1536 if (match_netid(tmp->netid, netid, netid ? 0 : 1)) return tmp; in option_find2()
1538 return netid ? option_find2(NULL, opts, opt) : NULL; in option_find2()
1603 static int prune_vendor_opts(struct dhcp_netid* netid) { in prune_vendor_opts() argument
1610 if (!match_netid(opt->netid, netid, 1)) in prune_vendor_opts()
1618 static struct dhcp_opt* pxe_opts(int pxe_arch, struct dhcp_netid* netid) { in pxe_opts() argument
1644 fake_opts[i].netid = NULL; in pxe_opts()
1653 if (pxe_arch == service->CSA && match_netid(service->netid, netid, 1)) { in pxe_opts()
1734 struct dhcp_boot* find_boot(struct dhcp_netid* netid) { in find_boot() argument
1739 if (match_netid(boot->netid, netid, 0)) break; in find_boot()
1742 if (match_netid(boot->netid, netid, 1)) break; in find_boot()
1749 char* config_domain, struct dhcp_netid* netid, struct in_addr subnet_addr, in do_options() argument
1785 if ((boot = find_boot(netid))) { in do_options()
1810 (opt = option_find2(netid, config_opts, OPTION_FILENAME)) && in do_options()
1817 (opt = option_find2(netid, config_opts, OPTION_SNAME)) && !(opt->flags & DHOPT_FORCE)) { in do_options()
1822 if ((opt = option_find2(netid, config_opts, OPTION_END))) in do_options()
1847 if (!option_find2(netid, config_opts, OPTION_NETMASK)) in do_options()
1852 if (context->broadcast.s_addr && !option_find2(netid, config_opts, OPTION_BROADCAST)) in do_options()
1858 !option_find2(netid, config_opts, OPTION_ROUTER)) in do_options()
1862 !option_find2(netid, config_opts, OPTION_DNSSERVER)) in do_options()
1867 !option_find2(netid, config_opts, OPTION_DOMAINNAME)) in do_options()
1873 !option_find2(netid, config_opts, OPTION_HOSTNAME)) in do_options()
1925 if (opt != option_find2(netid, config_opts, optno)) continue; in do_options()
1967 if (match_netid(o->netid, netid, 1) && in do_options()
1980 force_encap = prune_vendor_opts(netid); in do_options()
1985 config_opts = pxe_opts(pxe_arch, netid); in do_options()