Lines Matching refs:new

655     struct dhcp_opt* new = opt_malloc(sizeof(struct dhcp_opt));  in parse_dhcp_opt()  local
662 new->len = 0; in parse_dhcp_opt()
663 new->flags = flags; in parse_dhcp_opt()
664 new->netid = NULL; in parse_dhcp_opt()
665 new->val = NULL; in parse_dhcp_opt()
666 new->opt = 0; in parse_dhcp_opt()
675 new->opt = atoi(arg); in parse_dhcp_opt()
683 new->opt = opttab[i].val; in parse_dhcp_opt()
690 new->u.vendor_class = (unsigned char*) opt_string_alloc(arg + 7); in parse_dhcp_opt()
691 new->flags |= DHOPT_VENDOR; in parse_dhcp_opt()
693 new->u.encap = atoi(arg + 6); in parse_dhcp_opt()
694 new->flags |= DHOPT_ENCAPSULATE; in parse_dhcp_opt()
696 new->netid = opt_malloc(sizeof(struct dhcp_netid)); in parse_dhcp_opt()
699 new->netid->net = opt_string_alloc(arg + 4); in parse_dhcp_opt()
701 new->netid->net = opt_string_alloc(arg); in parse_dhcp_opt()
702 new->netid->next = np; in parse_dhcp_opt()
703 np = new->netid; in parse_dhcp_opt()
709 if (new->opt == 0) in parse_dhcp_opt()
755 new->len = digs; in parse_dhcp_opt()
756 new->val = opt_malloc(new->len); in parse_dhcp_opt()
757 parse_hex(comma, new->val, digs, (flags & DHOPT_MATCH) ? &new->u.wildcard_mask : NULL, in parse_dhcp_opt()
759 new->flags |= DHOPT_HEX; in parse_dhcp_opt()
766 new->len = opt_len; in parse_dhcp_opt()
768 new->len = 4; in parse_dhcp_opt()
770 new->len = 2; in parse_dhcp_opt()
772 new->len = 1; in parse_dhcp_opt()
775 new->len = 1; in parse_dhcp_opt()
777 new->len = 2; in parse_dhcp_opt()
779 new->len = 4; in parse_dhcp_opt()
781 new->val = opt_malloc(new->len); in parse_dhcp_opt()
782 for (i = 0; i < new->len; i++) new->val[i] = val >> ((new->len - i - 1) * 8); in parse_dhcp_opt()
789 new->val = op = opt_malloc((5 * addrs) + 1); in parse_dhcp_opt()
790 new->flags |= DHOPT_ADDR; in parse_dhcp_opt()
792 if (!(new->flags& DHOPT_ENCAPSULATE) && new->opt == 120) { in parse_dhcp_opt()
794 new->flags &= ~DHOPT_ADDR; in parse_dhcp_opt()
812 new->flags &= ~DHOPT_ADDR; /* cannot re-write descriptor format */ in parse_dhcp_opt()
815 new->len = op - new->val; in parse_dhcp_opt()
818 if ((new->opt == 119 || new->opt == 120) && !(new->flags& DHOPT_ENCAPSULATE)) { in parse_dhcp_opt()
823 int header_size = (new->opt == 119) ? 0 : 1; in parse_dhcp_opt()
869 if (new->opt == 120) m[0] = 0; in parse_dhcp_opt()
870 new->len = (int) len + header_size; in parse_dhcp_opt()
871 new->val = m; in parse_dhcp_opt()
873 new->len = strlen(comma); in parse_dhcp_opt()
875 new->val = (unsigned char*) opt_string_alloc(comma); in parse_dhcp_opt()
876 new->flags |= DHOPT_STRING; in parse_dhcp_opt()
881 if ((new->len > 255) || (new->len > 253 && (new->flags&(DHOPT_VENDOR | DHOPT_ENCAPSULATE)))) in parse_dhcp_opt()
886 if ((new->flags&(DHOPT_ENCAPSULATE | DHOPT_VENDOR)) || !new->netid || new->netid->next) in parse_dhcp_opt()
889 new->next = daemon->dhcp_match; in parse_dhcp_opt()
890 daemon->dhcp_match = new; in parse_dhcp_opt()
893 new->next = daemon->dhcp_opts; in parse_dhcp_opt()
894 daemon->dhcp_opts = new; in parse_dhcp_opt()
1049 struct resolvc* new, *list = daemon->resolv_files; in one_opt() local
1059 new = opt_malloc(sizeof(struct resolvc)); in one_opt()
1060 new->next = list; in one_opt()
1061 new->name = name; in one_opt()
1062 new->is_default = 0; in one_opt()
1063 new->mtime = 0; in one_opt()
1064 new->logged = 0; in one_opt()
1065 list = new; in one_opt()
1074 struct mx_srv_record* new; in one_opt() local
1086 new = opt_malloc(sizeof(struct mx_srv_record)); in one_opt()
1087 new->next = daemon->mxnames; in one_opt()
1088 daemon->mxnames = new; in one_opt()
1089 new->issrv = 0; in one_opt()
1090 new->name = name; in one_opt()
1091 new->target = target; /* may be NULL */ in one_opt()
1092 new->weight = pref; in one_opt()
1118 struct hostsfile* new = opt_malloc(sizeof(struct hostsfile)); in one_opt() local
1120 new->fname = opt_string_alloc(arg); in one_opt()
1121 new->index = hosts_index++; in one_opt()
1122 new->flags = 0; in one_opt()
1123 new->next = daemon->addn_hosts; in one_opt()
1124 daemon->addn_hosts = new; in one_opt()
1138 struct cond_domain* new = safe_malloc(sizeof(struct cond_domain)); in one_opt() local
1142 if ((new->start.s_addr = inet_addr(comma)) == (in_addr_t) -1 || in one_opt()
1147 new->start.s_addr = ntohl(htonl(new->start.s_addr) & ~mask); in one_opt()
1148 new->end.s_addr = new->start.s_addr | htonl(mask); in one_opt()
1151 if ((new->start.s_addr = inet_addr(comma)) == (in_addr_t) -1 || in one_opt()
1152 (new->end.s_addr = inet_addr(arg)) == (in_addr_t) -1) in one_opt()
1154 } else if ((new->start.s_addr = new->end.s_addr = inet_addr(comma)) == in one_opt()
1158 new->domain = d; in one_opt()
1159 new->next = daemon->cond_domain; in one_opt()
1160 daemon->cond_domain = new; in one_opt()
1184 struct iname* new = opt_malloc(sizeof(struct iname)); in one_opt() local
1186 new->next = daemon->if_names; in one_opt()
1187 daemon->if_names = new; in one_opt()
1190 new->name = opt_string_alloc(arg); in one_opt()
1191 new->isloop = new->used = 0; in one_opt()
1199 struct iname* new = opt_malloc(sizeof(struct iname)); in one_opt() local
1201 new->name = opt_string_alloc(arg); in one_opt()
1203 new->next = daemon->if_except; in one_opt()
1204 daemon->if_except = new; in one_opt()
1206 new->next = daemon->dhcp_except; in one_opt()
1207 daemon->dhcp_except = new; in one_opt()
1229 struct iname* new = opt_malloc(sizeof(struct iname)); in one_opt() local
1232 new->next = daemon->if_addrs; in one_opt()
1233 if (arg && parse_addr(AF_INET, arg, &new->addr) != 0 && in one_opt()
1234 parse_addr(AF_INET6, arg, &new->addr) != 0) { in one_opt()
1239 daemon->if_addrs = new; in one_opt()
1429 struct dhcp_bridge* new = opt_malloc(sizeof(struct dhcp_bridge)); in one_opt() local
1435 strncpy(new->iface, arg, IF_NAMESIZE); in one_opt()
1436 new->alias = NULL; in one_opt()
1437 new->next = daemon->bridges; in one_opt()
1438 daemon->bridges = new; in one_opt()
1445 b->next = new->alias; in one_opt()
1446 new->alias = b; in one_opt()
1459 struct dhcp_context* new = opt_malloc(sizeof(struct dhcp_context)); in one_opt() local
1461 new->next = daemon->dhcp; in one_opt()
1462 new->lease_time = DEFLEASE; in one_opt()
1463 new->addr_epoch = 0; in one_opt()
1464 new->netmask.s_addr = 0; in one_opt()
1465 new->broadcast.s_addr = 0; in one_opt()
1466 new->router.s_addr = 0; in one_opt()
1467 new->netid.net = NULL; in one_opt()
1468 new->filter = NULL; in one_opt()
1469 new->flags = 0; in one_opt()
1486 tt->next = new->filter; in one_opt()
1487 new->filter = tt; in one_opt()
1489 if (new->netid.net) in one_opt()
1492 new->netid.net = opt_string_alloc(arg); in one_opt()
1504 if ((k < 2) || ((new->start.s_addr = inet_addr(a[0])) == (in_addr_t) -1)) in one_opt()
1507 new->end = new->start; in one_opt()
1508 new->flags |= CONTEXT_STATIC; in one_opt()
1510 new->end = new->start; in one_opt()
1511 new->flags |= CONTEXT_PROXY; in one_opt()
1512 } else if ((new->end.s_addr = inet_addr(a[1])) == (in_addr_t) -1) in one_opt()
1515 if (ntohl(new->start.s_addr) > ntohl(new->end.s_addr)) { in one_opt()
1516 struct in_addr tmp = new->start; in one_opt()
1517 new->start = new->end; in one_opt()
1518 new->end = tmp; in one_opt()
1522 ((new->netmask.s_addr = inet_addr(a[2])) != (in_addr_t) -1)) { in one_opt()
1523 new->flags |= CONTEXT_NETMASK; in one_opt()
1525 if (!is_same_net(new->start, new->end, new->netmask)) in one_opt()
1528 daemon->dhcp = new; in one_opt()
1531 ((new->broadcast.s_addr = inet_addr(a[3])) != (in_addr_t) -1)) { in one_opt()
1532 new->flags |= CONTEXT_BRDCAST; in one_opt()
1538 new->lease_time = 0xffffffff; in one_opt()
1560 new->lease_time = atoi(a[leasepos]) * fac; in one_opt()
1563 if (new->lease_time < 120) new->lease_time = 120; in one_opt()
1575 struct dhcp_config* new; in one_opt() local
1578 new = opt_malloc(sizeof(struct dhcp_config)); in one_opt()
1580 new->next = daemon->dhcp_conf; in one_opt()
1581 new->flags = (option == LOPT_BANK) ? CONFIG_BANK : 0; in one_opt()
1582 new->hwaddr = NULL; in one_opt()
1596 new->flags |= CONFIG_NOCLID; in one_opt()
1607 if ((new->clid = opt_malloc(len))) { in one_opt()
1608 new->flags |= CONFIG_CLID; in one_opt()
1609 new->clid_len = len; in one_opt()
1610 memcpy(new->clid, arg, len); in one_opt()
1615 if ((new->netid.net = opt_malloc(len))) { in one_opt()
1616 new->flags |= CONFIG_NETID; in one_opt()
1617 strcpy(new->netid.net, arg + 4); in one_opt()
1618 unhide_metas(new->netid.net); in one_opt()
1622 newhw->next = new->hwaddr; in one_opt()
1623 new->hwaddr = newhw; in one_opt()
1628 new->addr = in; in one_opt()
1629 new->flags |= CONFIG_ADDR; in one_opt()
1662 new->lease_time = 0xffffffff; in one_opt()
1663 new->flags |= CONFIG_TIME; in one_opt()
1665 new->flags |= CONFIG_DISABLE; in one_opt()
1667 if (!(new->hostname = canonicalise_opt(a[j])) || in one_opt()
1668 !legal_hostname(new->hostname)) in one_opt()
1671 new->flags |= CONFIG_NAME; in one_opt()
1672 new->domain = NULL; in one_opt()
1675 new->lease_time = atoi(a[j]) * fac; in one_opt()
1678 if (new->lease_time < 120) new->lease_time = 120; in one_opt()
1679 new->flags |= CONFIG_TIME; in one_opt()
1683 daemon->dhcp_conf = new; in one_opt()
1729 struct dhcp_boot* new = opt_malloc(sizeof(struct dhcp_boot)); in one_opt() local
1730 new->file = dhcp_file; in one_opt()
1731 new->sname = dhcp_sname; in one_opt()
1732 new->next_server = dhcp_next_server; in one_opt()
1733 new->netid = id; in one_opt()
1734 new->next = daemon->boot_config; in one_opt()
1735 daemon->boot_config = new; in one_opt()
1744 struct dhcp_opt* new = opt_malloc(sizeof(struct dhcp_opt)); in one_opt() local
1747 new->netid = NULL; in one_opt()
1748 new->opt = 10; /* PXE_MENU_PROMPT */ in one_opt()
1753 nn->next = new->netid; in one_opt()
1754 new->netid = nn; in one_opt()
1764 new->len = strlen(arg) + 1; in one_opt()
1765 new->val = opt_malloc(new->len); in one_opt()
1766 memcpy(new->val + 1, arg, new->len - 1); in one_opt()
1768 new->u.vendor_class = (unsigned char*) "PXEClient"; in one_opt()
1769 new->flags = DHOPT_VENDOR; in one_opt()
1772 *(new->val) = timeout; in one_opt()
1774 *(new->val) = 255; in one_opt()
1776 new->next = daemon->dhcp_opts; in one_opt()
1777 daemon->dhcp_opts = new; in one_opt()
1786 struct pxe_service* new = opt_malloc(sizeof(struct pxe_service)); in one_opt() local
1792 new->netid = NULL; in one_opt()
1793 new->server.s_addr = 0; in one_opt()
1798 nn->next = new->netid; in one_opt()
1799 new->netid = nn; in one_opt()
1812 new->CSA = i; in one_opt()
1813 new->menu = opt_string_alloc(arg); in one_opt()
1819 new->type = i; in one_opt()
1820 new->basename = NULL; in one_opt()
1822 new->type = boottype++; in one_opt()
1823 new->basename = opt_string_alloc(arg); in one_opt()
1826 if (comma && (new->server.s_addr = inet_addr(comma)) == (in_addr_t) -1) in one_opt()
1830 new->next = NULL; in one_opt()
1832 daemon->pxe_services = new; in one_opt()
1837 s->next = new; in one_opt()
1855 struct dhcp_mac* new = opt_malloc(sizeof(struct dhcp_mac)); in one_opt() local
1857 new->netid.net = opt_string_alloc(arg + 4); in one_opt()
1859 new->netid.net = opt_string_alloc(arg); in one_opt()
1861 new->hwaddr_len = in one_opt()
1862 parse_hex(comma, new->hwaddr, DHCP_CHADDR_MAX, &new->mask, &new->hwaddr_type); in one_opt()
1863 new->next = daemon->dhcp_macs; in one_opt()
1864 daemon->dhcp_macs = new; in one_opt()
1879 struct dhcp_vendor* new = opt_malloc(sizeof(struct dhcp_vendor)); in one_opt() local
1881 new->netid.net = opt_string_alloc(arg + 4); in one_opt()
1883 new->netid.net = opt_string_alloc(arg); in one_opt()
1893 new->len = strlen(comma); in one_opt()
1894 new->data = opt_malloc(new->len); in one_opt()
1895 memcpy(new->data, comma, new->len); in one_opt()
1897 new->len = parse_hex(comma, (unsigned char*) comma, strlen(comma), NULL, NULL); in one_opt()
1898 new->data = opt_malloc(new->len); in one_opt()
1899 memcpy(new->data, comma, new->len); in one_opt()
1904 new->match_type = MATCH_USER; in one_opt()
1907 new->match_type = MATCH_VENDOR; in one_opt()
1910 new->match_type = MATCH_CIRCUIT; in one_opt()
1913 new->match_type = MATCH_REMOTE; in one_opt()
1916 new->match_type = MATCH_SUBSCRIBER; in one_opt()
1919 new->next = daemon->dhcp_vendors; in one_opt()
1920 daemon->dhcp_vendors = new; in one_opt()
1943 struct dhcp_netid_list* new = opt_malloc(sizeof(struct dhcp_netid_list)); in one_opt() local
1946 new->next = daemon->dhcp_ignore; in one_opt()
1947 daemon->dhcp_ignore = new; in one_opt()
1949 new->next = daemon->force_broadcast; in one_opt()
1950 daemon->force_broadcast = new; in one_opt()
1952 new->next = daemon->bootp_dynamic; in one_opt()
1953 daemon->bootp_dynamic = new; in one_opt()
1955 new->next = daemon->dhcp_ignore_names; in one_opt()
1956 daemon->dhcp_ignore_names = new; in one_opt()
1971 new->list = list; in one_opt()
1980 struct doctor* new = opt_malloc(sizeof(struct doctor)); in one_opt() local
1981 new->next = daemon->doctors; in one_opt()
1982 daemon->doctors = new; in one_opt()
1983 new->mask.s_addr = 0xffffffff; in one_opt()
1984 new->end.s_addr = 0; in one_opt()
1994 if ((k < 2) || ((new->in.s_addr = inet_addr(a[0])) == (in_addr_t) -1) || in one_opt()
1995 ((new->out.s_addr = inet_addr(a[1])) == (in_addr_t) -1)) in one_opt()
1998 if (k == 3) new->mask.s_addr = inet_addr(a[2]); in one_opt()
2000 if (dash && ((new->end.s_addr = inet_addr(dash)) == (in_addr_t) -1 || in one_opt()
2001 !is_same_net(new->in, new->end, new->mask) || in one_opt()
2002 ntohl(new->in.s_addr) > ntohl(new->end.s_addr))) in one_opt()
2010 struct interface_name* new, **up; in one_opt() local
2017 new = opt_malloc(sizeof(struct interface_name)); in one_opt()
2018 new->next = NULL; in one_opt()
2023 *up = new; in one_opt()
2024 new->name = domain; in one_opt()
2025 new->intr = opt_string_alloc(comma); in one_opt()
2031 struct cname* new; in one_opt() local
2042 for (new = daemon->cnames; new; new = new->next) in one_opt()
2043 if (hostname_isequal(new->alias, arg)) problem = _("duplicate CNAME"); in one_opt()
2044 new = opt_malloc(sizeof(struct cname)); in one_opt()
2045 new->next = daemon->cnames; in one_opt()
2046 daemon->cnames = new; in one_opt()
2047 new->alias = alias; in one_opt()
2048 new->target = target; in one_opt()
2056 struct ptr_record* new; in one_opt() local
2064 new = opt_malloc(sizeof(struct ptr_record)); in one_opt()
2065 new->next = daemon->ptr; in one_opt()
2066 daemon->ptr = new; in one_opt()
2067 new->name = dom; in one_opt()
2068 new->ptr = target; in one_opt()
2077 struct naptr* new; in one_opt() local
2089 new = opt_malloc(sizeof(struct naptr)); in one_opt()
2090 new->next = daemon->naptr; in one_opt()
2091 daemon->naptr = new; in one_opt()
2092 new->name = name; in one_opt()
2093 new->flags = opt_string_alloc(a[3]); in one_opt()
2094 new->services = opt_string_alloc(a[4]); in one_opt()
2095 new->regexp = opt_string_alloc(a[5]); in one_opt()
2096 new->replace = replace; in one_opt()
2097 new->order = order; in one_opt()
2098 new->pref = pref; in one_opt()
2105 struct txt_record* new; in one_opt() local
2127 new = opt_malloc(sizeof(struct txt_record)); in one_opt()
2128 new->next = daemon->txt; in one_opt()
2129 daemon->txt = new; in one_opt()
2130 new->class = C_IN; in one_opt()
2132 new->len = q - ((unsigned char*) comma); in one_opt()
2133 new->txt = opt_malloc(new->len); in one_opt()
2134 memcpy(new->txt, comma, new->len); in one_opt()
2137 new->len = 1; in one_opt()
2138 new->txt = empty; in one_opt()
2144 if (!(new->name = canonicalise_opt(arg))) { in one_opt()
2156 struct mx_srv_record* new; in one_opt() local
2186 new = opt_malloc(sizeof(struct mx_srv_record)); in one_opt()
2187 new->next = daemon->mxnames; in one_opt()
2188 daemon->mxnames = new; in one_opt()
2189 new->issrv = 1; in one_opt()
2190 new->name = name; in one_opt()
2191 new->target = target; in one_opt()
2192 new->srvport = port; in one_opt()
2193 new->priority = priority; in one_opt()
2194 new->weight = weight; in one_opt()