Lines Matching refs:uc

75 nat64lsn_default_config(ipfw_nat64lsn_cfg *uc)
78 if (uc->max_ports == 0)
79 uc->max_ports = NAT64LSN_MAX_PORTS;
81 uc->max_ports = roundup(uc->max_ports, NAT64_CHUNK_SIZE);
82 if (uc->max_ports > NAT64_CHUNK_SIZE * NAT64LSN_MAXPGPTR)
83 uc->max_ports = NAT64_CHUNK_SIZE * NAT64LSN_MAXPGPTR;
84 if (uc->jmaxlen == 0)
85 uc->jmaxlen = NAT64LSN_JMAXLEN;
86 if (uc->jmaxlen > 65536)
87 uc->jmaxlen = 65536;
88 if (uc->nh_delete_delay == 0)
89 uc->nh_delete_delay = NAT64LSN_HOST_AGE;
90 if (uc->pg_delete_delay == 0)
91 uc->pg_delete_delay = NAT64LSN_PG_AGE;
92 if (uc->st_syn_ttl == 0)
93 uc->st_syn_ttl = NAT64LSN_TCP_SYN_AGE;
94 if (uc->st_close_ttl == 0)
95 uc->st_close_ttl = NAT64LSN_TCP_FIN_AGE;
96 if (uc->st_estab_ttl == 0)
97 uc->st_estab_ttl = NAT64LSN_TCP_EST_AGE;
98 if (uc->st_udp_ttl == 0)
99 uc->st_udp_ttl = NAT64LSN_UDP_AGE;
100 if (uc->st_icmp_ttl == 0)
101 uc->st_icmp_ttl = NAT64LSN_ICMP_AGE;
116 ipfw_nat64lsn_cfg *uc;
121 if (sd->valsize != sizeof(*olh) + sizeof(*uc))
125 uc = (ipfw_nat64lsn_cfg *)(olh + 1);
127 if (ipfw_check_object_name_generic(uc->name) != 0)
130 if (uc->agg_prefix_len > 127 || uc->set >= IPFW_MAX_SETS)
133 if (uc->plen4 > 32)
135 if (nat64_check_prefix6(&uc->prefix6, uc->plen6) != 0)
139 addr4 = ntohl(uc->prefix4.s_addr);
140 mask4 = ~((1 << (32 - uc->plen4)) - 1);
143 if (uc->min_port == 0)
144 uc->min_port = NAT64_MIN_PORT;
145 if (uc->max_port == 0)
146 uc->max_port = 65535;
147 if (uc->min_port > uc->max_port)
149 uc->min_port = roundup(uc->min_port, NAT64_CHUNK_SIZE);
150 uc->max_port = roundup(uc->max_port, NAT64_CHUNK_SIZE);
152 nat64lsn_default_config(uc);
156 if (nat64lsn_find(ni, uc->name, uc->set) != NULL) {
162 cfg = nat64lsn_init_instance(ch, 1 << (32 - uc->plen4));
163 strlcpy(cfg->name, uc->name, sizeof(cfg->name));
166 cfg->no.set = uc->set;
168 cfg->base.plat_prefix = uc->prefix6;
169 cfg->base.plat_plen = uc->plen6;
170 cfg->base.flags = (uc->flags & NAT64LSN_FLAGSMASK) | NAT64_PLATPFX;
176 cfg->plen4 = uc->plen4;
178 cfg->max_chunks = uc->max_ports / NAT64_CHUNK_SIZE;
179 cfg->agg_prefix_len = uc->agg_prefix_len;
180 cfg->agg_prefix_max = uc->agg_prefix_max;
182 cfg->min_chunk = uc->min_port / NAT64_CHUNK_SIZE;
183 cfg->max_chunk = uc->max_port / NAT64_CHUNK_SIZE;
185 cfg->jmaxlen = uc->jmaxlen;
186 cfg->nh_delete_delay = uc->nh_delete_delay;
187 cfg->pg_delete_delay = uc->pg_delete_delay;
188 cfg->st_syn_ttl = uc->st_syn_ttl;
189 cfg->st_close_ttl = uc->st_close_ttl;
190 cfg->st_estab_ttl = uc->st_estab_ttl;
191 cfg->st_udp_ttl = uc->st_udp_ttl;
192 cfg->st_icmp_ttl = uc->st_icmp_ttl;
198 if (nat64lsn_find(ni, uc->name, uc->set) != NULL) {
311 ipfw_nat64lsn_cfg *uc)
314 uc->flags = cfg->base.flags & NAT64LSN_FLAGSMASK;
315 uc->max_ports = cfg->max_chunks * NAT64_CHUNK_SIZE;
316 uc->agg_prefix_len = cfg->agg_prefix_len;
317 uc->agg_prefix_max = cfg->agg_prefix_max;
319 uc->jmaxlen = cfg->jmaxlen;
320 uc->nh_delete_delay = cfg->nh_delete_delay;
321 uc->pg_delete_delay = cfg->pg_delete_delay;
322 uc->st_syn_ttl = cfg->st_syn_ttl;
323 uc->st_close_ttl = cfg->st_close_ttl;
324 uc->st_estab_ttl = cfg->st_estab_ttl;
325 uc->st_udp_ttl = cfg->st_udp_ttl;
326 uc->st_icmp_ttl = cfg->st_icmp_ttl;
327 uc->prefix4.s_addr = htonl(cfg->prefix4);
328 uc->prefix6 = cfg->base.plat_prefix;
329 uc->plen4 = cfg->plen4;
330 uc->plen6 = cfg->base.plat_plen;
331 uc->set = cfg->no.set;
332 strlcpy(uc->name, cfg->no.name, sizeof(uc->name));
345 ipfw_nat64lsn_cfg *uc;
347 uc = (struct _ipfw_nat64lsn_cfg *)ipfw_get_sopt_space(da->sd,
348 sizeof(*uc));
349 nat64lsn_export_config(da->ch, (struct nat64lsn_cfg *)no, uc);
407 ipfw_nat64lsn_cfg *uc;
411 if (sd->valsize != sizeof(*oh) + sizeof(*uc))
415 sizeof(*oh) + sizeof(*uc));
416 uc = (ipfw_nat64lsn_cfg *)(oh + 1);
430 nat64lsn_export_config(ch, cfg, uc);
435 nat64lsn_default_config(uc);
450 cfg->max_chunks = uc->max_ports / NAT64_CHUNK_SIZE;
451 cfg->jmaxlen = uc->jmaxlen;
452 cfg->nh_delete_delay = uc->nh_delete_delay;
453 cfg->pg_delete_delay = uc->pg_delete_delay;
454 cfg->st_syn_ttl = uc->st_syn_ttl;
455 cfg->st_close_ttl = uc->st_close_ttl;
456 cfg->st_estab_ttl = uc->st_estab_ttl;
457 cfg->st_udp_ttl = uc->st_udp_ttl;
458 cfg->st_icmp_ttl = uc->st_icmp_ttl;
460 cfg->base.flags |= uc->flags & NAT64LSN_FLAGSMASK;