Lines Matching refs:netid
97 static size_t dhcp_packet_size(struct dhcp_packet *mess, struct dhcp_netid *netid,
106 struct dhcp_netid *netid,
116 static int prune_vendor_opts(struct dhcp_netid *netid);
117 static struct dhcp_opt *pxe_opts(int pxe_arch, struct dhcp_netid *netid);
118 struct dhcp_boot *find_boot(struct dhcp_netid *netid);
139 struct dhcp_netid *netid;
156 netid = &iface_id;
240 vendor->netid.next = netid;
241 netid = &vendor->netid;
278 mac->netid.next = netid;
279 netid = &mac->netid;
369 known_id.next = netid;
370 netid = &known_id;
396 config->netid.next = netid;
397 netid = &config->netid;
400 /* Match incoming filename field as a netid. */
406 id.next = netid;
407 netid = &id;
413 bootp_id.next = netid;
414 netid = &bootp_id;
417 if (match_netid(id_list->list, netid, 0))
438 !address_available(context, lease->addr, netid))
446 if (!address_allocate(context, &mess->yiaddr, mess->chaddr, mess->hlen, netid, now))
453 if (!message && !(context = narrow_context(context, mess->yiaddr, netid)))
455 else if (context->netid.net)
457 context->netid.next = netid;
458 netid = &context->netid;
464 if ((!id_list->list) || match_netid(id_list->list, netid, 0))
490 domain, netid, subnet_addr, 0, 0, 0, NULL);
496 return message ? 0 : dhcp_packet_size(mess, netid, agent_id, real_end);
589 known_id.next = netid;
590 netid = &known_id;
598 config->netid.next = netid;
599 netid = &config->netid;
637 o->netid->next = netid;
638 netid = o->netid;
683 vendor->netid.next = netid;
684 netid = &vendor->netid;
703 if (match_netid(id_list->list, netid, 0))
764 prune_vendor_opts(netid);
769 opt71.netid = NULL;
774 return dhcp_packet_size(mess, netid, agent_id, real_end);
785 struct dhcp_boot *boot = find_boot(netid);
811 prune_vendor_opts(netid);
812 do_encap_opts(pxe_opts(pxearch, netid), OPTION_VENDOR_CLASS_OPT, DHOPT_VENDOR_MATCH, mess, end, 0);
815 return ignore ? 0 : dhcp_packet_size(mess, netid, agent_id, real_end);
866 if (!(context = narrow_context(context, mess->ciaddr, netid)) ||
928 address_available(context, lease->addr, netid) &&
931 else if (opt && address_available(context, addr, netid) && !lease_find_by_addr(addr) &&
936 else if (!address_allocate(context, &mess->yiaddr, emac, emac_len, netid, now))
942 if (message || !(context = narrow_context(context, mess->yiaddr, netid)))
947 if (context->netid.net)
949 context->netid.next = netid;
950 netid = &context->netid;
965 domain, netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid);
967 return dhcp_packet_size(mess, netid, agent_id, real_end);
1060 if (!(context = narrow_context(context, mess->yiaddr, netid)))
1069 else if (!address_available(context, mess->yiaddr, netid) &&
1192 if (context->netid.net)
1194 context->netid.next = netid;
1195 netid = &context->netid;
1205 if ((!id_list->list) || match_netid(id_list->list, netid, 0))
1235 domain, netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid);
1238 return dhcp_packet_size(mess, netid, agent_id, real_end);
1250 context = narrow_context(context, mess->ciaddr, netid);
1264 if (context && context->netid.net)
1266 context->netid.next = netid;
1267 netid = &context->netid;
1293 domain, netid, subnet_addr, fqdn_flags, borken_opt, pxearch, uuid);
1296 return dhcp_packet_size(mess, netid, agent_id, real_end);
1548 static size_t dhcp_packet_size(struct dhcp_packet *mess, struct dhcp_netid *netid,
1566 if (netid && (daemon->options & OPT_LOG_OPTS))
1569 for (*s = 0; netid; netid = netid->next)
1572 for (n = netid->next; n; n = n->next)
1573 if (strcmp(netid->net, n->net) == 0)
1578 strncat (s, netid->net, (MAXDNAME-1) - strlen(s));
1579 if (netid->next)
1619 if (match_netid(id_list->list, netid, 0))
1760 static struct dhcp_opt *option_find2(struct dhcp_netid *netid, struct dhcp_opt *opts, int opt)
1765 if (match_netid(tmp->netid, netid, netid ? 0 : 1))
1768 return netid ? option_find2(NULL, opts, opt) : NULL;
1847 static int prune_vendor_opts(struct dhcp_netid *netid)
1852 /* prune vendor-encapsulated options based on netid, and look if we're forcing them to be sent */
1856 if (!match_netid(opt->netid, netid, 1))
1864 static struct dhcp_opt *pxe_opts(int pxe_arch, struct dhcp_netid *netid)
1893 fake_opts[i].netid = NULL;
1902 if (pxe_arch == service->CSA && match_netid(service->netid, netid, 1))
1997 struct dhcp_boot *find_boot(struct dhcp_netid *netid)
2003 if (match_netid(boot->netid, netid, 0))
2006 /* No match, look for one without a netid */
2008 if (match_netid(boot->netid, netid, 1))
2020 struct dhcp_netid *netid,
2066 if ((boot = find_boot(netid)))
2098 (opt = option_find2(netid
2105 (opt = option_find2(netid, config_opts, OPTION_SNAME)) && !(opt->flags & DHOPT_FORCE))
2111 if ((opt = option_find2(netid, config_opts, OPTION_END)))
2139 if (!option_find2(netid, config_opts, OPTION_NETMASK))
2145 !option_find2(netid, config_opts, OPTION_BROADCAST))
2152 !option_find2(netid, config_opts, OPTION_ROUTER))
2156 !option_find2(netid, config_opts, OPTION_DNSSERVER))
2161 !option_find2(netid, config_opts, OPTION_DOMAINNAME))
2168 !option_find2(netid, config_opts, OPTION_HOSTNAME))
2236 if (opt != option_find2(netid, config_opts, optno))
2290 if (match_netid(o->netid, netid, 1) &&
2304 force_encap = prune_vendor_opts(netid);
2311 config_opts = pxe_opts(pxe_arch, netid);