Lines Matching refs:new

668   struct dhcp_opt *new = opt_malloc(sizeof(struct dhcp_opt));
675 new->len = 0;
676 new->flags = flags;
677 new->netid = NULL;
678 new->val = NULL;
679 new->opt = 0;
691 new->opt = atoi(arg);
702 new->opt = opttab[i].val;
711 new->u.vendor_class = (unsigned char *)opt_string_alloc(arg+7);
712 new->flags |= DHOPT_VENDOR;
716 new->u.encap = atoi(arg+6);
717 new->flags |= DHOPT_ENCAPSULATE;
721 new->netid = opt_malloc(sizeof (struct dhcp_netid));
724 new->netid->net = opt_string_alloc(arg+4);
726 new->netid->net = opt_string_alloc(arg);
727 new->netid->next = np;
728 np = new->netid;
734 if (new->opt == 0)
797 new->len = digs;
798 new->val = opt_malloc(new->len);
799 parse_hex(comma, new->val, digs, (flags & DHOPT_MATCH) ? &new->u.wildcard_mask : NULL, NULL);
800 new->flags |= DHOPT_HEX;
809 new->len = opt_len;
811 new->len = 4;
813 new->len = 2;
815 new->len = 1;
818 new->len = 1;
820 new->len = 2;
822 new->len = 4;
824 new->val = opt_malloc(new->len);
825 for (i=0; i<new->len; i++)
826 new->val[i] = val>>((new->len - i - 1)*8);
835 new->val = op = opt_malloc((5 * addrs) + 1);
836 new->flags |= DHOPT_ADDR;
838 if (!(new->flags & DHOPT_ENCAPSULATE) && new->opt == 120)
841 new->flags &= ~DHOPT_ADDR;
867 new->flags &= ~DHOPT_ADDR; /* cannot re-write descriptor format */
870 new->len = op - new->val;
875 if ((new->opt == 119 || new->opt == 120) && !(new->flags & DHOPT_ENCAPSULATE))
881 int header_size = (new->opt == 119) ? 0 : 1;
934 if (new->opt == 120)
936 new->len = (int) len + header_size;
937 new->val = m;
941 new->len = strlen(comma);
943 new->val = (unsigned char *)opt_string_alloc(comma);
944 new->flags |= DHOPT_STRING;
949 if ((new->len > 255) || (new->len > 253 && (new->flags & (DHOPT_VENDOR | DHOPT_ENCAPSULATE))))
956 if ((new->flags & (DHOPT_ENCAPSULATE | DHOPT_VENDOR)) ||
957 !new->netid ||
958 new->netid->next)
962 new->next = daemon->dhcp_match;
963 daemon->dhcp_match = new;
968 new->next = daemon->dhcp_opts;
969 daemon->dhcp_opts = new;
1150 struct resolvc *new, *list = daemon->resolv_files;
1165 new = opt_malloc(sizeof(struct resolvc));
1166 new->next = list;
1167 new->name = name;
1168 new->is_default = 0;
1169 new->mtime = 0;
1170 new->logged = 0;
1171 list = new;
1180 struct mx_srv_record *new;
1194 new = opt_malloc(sizeof(struct mx_srv_record));
1195 new->next = daemon->mxnames;
1196 daemon->mxnames = new;
1197 new->issrv = 0;
1198 new->name = name;
1199 new->target = target; /* may be NULL */
1200 new->weight = pref;
1227 struct hostsfile *new = opt_malloc(sizeof(struct hostsfile));
1229 new->fname = opt_string_alloc(arg);
1230 new->index = hosts_index++;
1231 new->flags = 0;
1232 new->next = daemon->addn_hosts;
1233 daemon->addn_hosts = new;
1250 struct cond_domain *new = safe_malloc(sizeof(struct cond_domain));
1255 if ((new->start.s_addr = inet_addr(comma)) == (in_addr_t)-1 ||
1261 new->start.s_addr = ntohl(htonl(new->start.s_addr) & ~mask);
1262 new->end.s_addr = new->start.s_addr | htonl(mask);
1267 if ((new->start.s_addr = inet_addr(comma)) == (in_addr_t)-1 ||
1268 (new->end.s_addr = inet_addr(arg)) == (in_addr_t)-1)
1271 else if ((new->start.s_addr = new->end.s_addr = inet_addr(comma)) == (in_addr_t)-1)
1274 new->domain = d;
1275 new->next = daemon->cond_domain;
1276 daemon->cond_domain = new;
1301 struct iname *new = opt_malloc(sizeof(struct iname));
1303 new->next = daemon->if_names;
1304 daemon->if_names = new;
1305 /* new->name may be NULL if someone does
1307 new->name = opt_string_alloc(arg);
1308 new->isloop = new->used = 0;
1316 struct iname *new = opt_malloc(sizeof(struct iname));
1318 new->name = opt_string_alloc(arg);
1321 new->next = daemon->if_except;
1322 daemon->if_except = new;
1326 new->next = daemon->dhcp_except;
1327 daemon->dhcp_except = new;
1351 struct iname *new = opt_malloc(sizeof(struct iname));
1354 new->next = daemon->if_addrs;
1355 if (arg && (new->addr.in.sin_addr.s_addr = inet_addr(arg)) != (in_addr_t)-1)
1357 new->addr.sa.sa_family = AF_INET;
1359 new->addr.in.sin_len = sizeof(new->addr.in);
1363 else if (arg && inet_pton(AF_INET6, arg, &new->addr.in6.sin6_addr) > 0)
1365 new->addr.sa.sa_family = AF_INET6;
1366 new->addr.in6.sin6_flowinfo = 0;
1367 new->addr.in6.sin6_scope_id = 0;
1369 new->addr.in6.sin6_len = sizeof(new->addr.in6);
1379 daemon->if_addrs = new;
1629 struct dhcp_bridge *new = opt_malloc(sizeof(struct dhcp_bridge));
1636 strncpy(new->iface, arg, IF_NAMESIZE);
1637 new->alias = NULL;
1638 new->next = daemon->bridges;
1639 daemon->bridges = new;
1647 b->next = new->alias;
1648 new->alias = b;
1661 struct dhcp_context *new = opt_malloc(sizeof(struct dhcp_context));
1663 new->next = daemon->dhcp;
1664 new->lease_time = DEFLEASE;
1665 new->addr_epoch = 0;
1666 new->netmask.s_addr = 0;
1667 new->broadcast.s_addr = 0;
1668 new->router.s_addr = 0;
1669 new->netid.net = NULL;
1670 new->filter = NULL;
1671 new->flags = 0;
1693 tt->next = new->filter;
1694 new->filter = tt;
1698 if (new->netid.net)
1701 new->netid.net = opt_string_alloc(arg);
1716 if ((k < 2) || ((new->start.s_addr = inet_addr(a[0])) == (in_addr_t)-1))
1720 new->end = new->start;
1721 new->flags |= CONTEXT_STATIC;
1725 new->end = new->start;
1726 new->flags |= CONTEXT_PROXY;
1728 else if ((new->end.s_addr = inet_addr(a[1])) == (in_addr_t)-1)
1731 if (ntohl(new->start.s_addr) > ntohl(new->end.s_addr))
1733 struct in_addr tmp = new->start;
1734 new->start = new->end;
1735 new->end = tmp;
1739 ((new->netmask.s_addr = inet_addr(a[2])) != (in_addr_t)-1))
1741 new->flags |= CONTEXT_NETMASK;
1743 if (!is_same_net(new->start, new->end, new->netmask))
1746 daemon->dhcp = new;
1749 ((new->broadcast.s_addr = inet_addr(a[3])) != (in_addr_t)-1))
1751 new->flags |= CONTEXT_BRDCAST;
1758 new->lease_time = 0xffffffff;
1783 new->lease_time = atoi(a[leasepos]) * fac;
1786 if (new->lease_time < 120)
1787 new->lease_time = 120;
1799 struct dhcp_config *new;
1802 new = opt_malloc(sizeof(struct dhcp_config));
1804 new->next = daemon->dhcp_conf;
1805 new->flags = (option == LOPT_BANK) ? CONFIG_BANK : 0;
1806 new->hwaddr = NULL;
1823 new->flags |= CONFIG_NOCLID;
1836 if ((new->clid = opt_malloc(len)))
1838 new->flags |= CONFIG_CLID;
1839 new->clid_len = len;
1840 memcpy(new->clid, arg, len);
1847 if ((new->netid.net = opt_malloc(len)))
1849 new->flags |= CONFIG_NETID;
1850 strcpy(new->netid.net, arg+4);
1851 unhide_metas(new->netid.net);
1857 newhw->next = new->hwaddr;
1858 new->hwaddr = newhw;
1865 new->addr = in;
1866 new->flags |= CONFIG_ADDR;
1907 new->lease_time = 0xffffffff;
1908 new->flags |= CONFIG_TIME;
1911 new->flags |= CONFIG_DISABLE;
1914 if (!(new->hostname = canonicalise_opt(a[j])) ||
1915 !legal_hostname(new->hostname))
1918 new->flags |= CONFIG_NAME;
1919 new->domain = NULL;
1924 new->lease_time = atoi(a[j]) * fac;
1927 if (new->lease_time < 120)
1928 new->lease_time = 120;
1929 new->flags |= CONFIG_TIME;
1933 daemon->dhcp_conf = new;
1983 struct dhcp_boot *new = opt_malloc(sizeof(struct dhcp_boot));
1984 new->file = dhcp_file;
1985 new->sname = dhcp_sname;
1986 new->next_server = dhcp_next_server;
1987 new->netid = id;
1988 new->next = daemon->boot_config;
1989 daemon->boot_config = new;
1998 struct dhcp_opt *new = opt_malloc(sizeof(struct dhcp_opt));
2001 new->netid = NULL;
2002 new->opt = 10; /* PXE_MENU_PROMPT */
2008 nn->next = new->netid;
2009 new->netid = nn;
2020 new->len = strlen(arg) + 1;
2021 new->val = opt_malloc(new->len);
2022 memcpy(new->val + 1, arg, new->len - 1);
2024 new->u.vendor_class = (unsigned char *)"PXEClient";
2025 new->flags = DHOPT_VENDOR;
2028 *(new->val) = timeout;
2030 *(new->val) = 255;
2032 new->next = daemon->dhcp_opts;
2033 daemon->dhcp_opts = new;
2042 struct pxe_service *new = opt_malloc(sizeof(struct pxe_service));
2047 new->netid = NULL;
2048 new->server.s_addr = 0;
2054 nn->next = new->netid;
2055 new->netid = nn;
2071 new->CSA = i;
2072 new->menu = opt_string_alloc(arg);
2080 new->type = i;
2081 new->basename = NULL;
2085 new->type = boottype++;
2086 new->basename = opt_string_alloc(arg);
2089 if (comma && (new->server.s_addr = inet_addr(comma)) == (in_addr_t)-1)
2093 new->next = NULL;
2095 daemon->pxe_services = new;
2100 s->next = new;
2119 struct dhcp_mac *new = opt_malloc(sizeof(struct dhcp_mac));
2121 new->netid.net = opt_string_alloc(arg+4);
2123 new->netid.net = opt_string_alloc(arg);
2125 new->hwaddr_len = parse_hex(comma, new->hwaddr, DHCP_CHADDR_MAX, &new->mask, &new->hwaddr_type);
2126 new->next = daemon->dhcp_macs;
2127 daemon->dhcp_macs = new;
2144 struct dhcp_vendor *new = opt_malloc(sizeof(struct dhcp_vendor));
2146 new->netid.net = opt_string_alloc(arg+4);
2148 new->netid.net = opt_string_alloc(arg);
2159 new->len = strlen(comma);
2160 new->data = opt_malloc(new->len);
2161 memcpy(new->data, comma, new->len);
2165 new->len = parse_hex(comma, (unsigned char *)comma, strlen(comma), NULL, NULL);
2166 new->data = opt_malloc(new->len);
2167 memcpy(new->data, comma, new->len);
2173 new->match_type = MATCH_USER;
2176 new->match_type = MATCH_VENDOR;
2179 new->match_type = MATCH_CIRCUIT;
2182 new->match_type = MATCH_REMOTE;
2185 new->match_type = MATCH_SUBSCRIBER;
2188 new->next = daemon->dhcp_vendors;
2189 daemon->dhcp_vendors = new;
2216 struct dhcp_netid_list *new = opt_malloc(sizeof(struct dhcp_netid_list));
2220 new->next = daemon->dhcp_ignore;
2221 daemon->dhcp_ignore = new;
2225 new->next = daemon->force_broadcast;
2226 daemon->force_broadcast = new;
2230 new->next = daemon->bootp_dynamic;
2231 daemon->bootp_dynamic = new;
2235 new->next = daemon->dhcp_ignore_names;
2236 daemon->dhcp_ignore_names = new;
2251 new->list = list;
2260 struct doctor *new = opt_malloc(sizeof(struct doctor));
2261 new->next = daemon->doctors;
2262 daemon->doctors = new;
2263 new->mask.s_addr = 0xffffffff;
2264 new->end.s_addr = 0;
2277 ((new->in.s_addr = inet_addr(a[0])) == (in_addr_t)-1) ||
2278 ((new->out.s_addr = inet_addr(a[1])) == (in_addr_t)-1))
2282 new->mask.s_addr = inet_addr(a[2]);
2285 ((new->end.s_addr = inet_addr(dash)) == (in_addr_t)-1 ||
2286 !is_same_net(new->in, new->end, new->mask) ||
2287 ntohl(new->in.s_addr) > ntohl(new->end.s_addr)))
2295 struct interface_name *new, **up;
2303 new = opt_malloc(sizeof(struct interface_name));
2304 new->next = NULL;
2308 *up = new;
2309 new->name = domain;
2310 new->intr = opt_string_alloc(comma);
2316 struct cname *new;
2329 for (new = daemon->cnames; new; new = new->next)
2330 if (hostname_isequal(new->alias, arg))
2332 new = opt_malloc(sizeof(struct cname));
2333 new->next = daemon->cnames;
2334 daemon->cnames = new;
2335 new->alias = alias;
2336 new->target = target;
2344 struct ptr_record *new;
2354 new = opt_malloc(sizeof(struct ptr_record));
2355 new->next = daemon->ptr;
2356 daemon->ptr = new;
2357 new->name = dom;
2358 new->ptr = target;
2367 struct naptr *new;
2385 new = opt_malloc(sizeof(struct naptr));
2386 new->next = daemon->naptr;
2387 daemon->naptr = new;
2388 new->name = name;
2389 new->flags = opt_string_alloc(a[3]);
2390 new->services = opt_string_alloc(a[4]);
2391 new->regexp = opt_string_alloc(a[5]);
2392 new->replace = replace;
2393 new->order = order;
2394 new->pref = pref;
2401 struct txt_record *new;
2432 new = opt_malloc(sizeof(struct txt_record));
2433 new->next = daemon->txt;
2434 daemon->txt = new;
2435 new->class = C_IN;
2438 new->len = q - ((unsigned char *)comma);
2439 new->txt = opt_malloc(new->len);
2440 memcpy(new->txt, comma, new->len);
2445 new->len = 1;
2446 new->txt = empty;
2453 if (!(new->name = canonicalise_opt(arg)))
2466 struct mx_srv_record *new;
2505 new = opt_malloc(sizeof(struct mx_srv_record));
2506 new->next = daemon->mxnames;
2507 daemon->mxnames = new;
2508 new->issrv = 1;
2509 new->name = name;
2510 new->target = target;
2511 new->srvport = port;
2512 new->priority = priority;
2513 new->weight = weight;