Lines Matching +full:1 +full:v

11  * 1. Redistributions of source code must retain the above copyright
29 * $Begemot: bsnmp/snmp_mibII/mibII_ip.c,v 1.11 2005/05/23 09:03:40 brandt_h Exp $
58 if (sysctlbyname("net.inet.ip.stats", &ipstat, &len, NULL, 0) == -1) { in fetch_ipstat()
60 return (-1); in fetch_ipstat()
64 return (-1); in fetch_ipstat()
67 if (sysctlbyname("net.inet.ip.intr_queue_drops", &ip_idrop, &len, NULL, 0) == -1) in fetch_ipstat()
74 if (sysctlbyname("net.inet.icmp.stats", &icmpstat, &len, NULL, 0) == -1) { in fetch_ipstat()
76 return (-1); in fetch_ipstat()
80 return (-1); in fetch_ipstat()
85 NULL, 0) == -1) { in fetch_ipstat()
87 return (-1); in fetch_ipstat()
91 return (-1); in fetch_ipstat()
105 NULL, 0) == -1) { in fetch_ip()
107 return (-1); in fetch_ip()
111 return (-1); in fetch_ip()
116 NULL, 0) == -1) { in fetch_ip()
118 return (-1); in fetch_ip()
122 return (-1); in fetch_ip()
136 &forw, sizeof(forw)) == -1) { in ip_forward()
138 return (-1); in ip_forward()
151 &ttl, sizeof(ttl)) == -1) { in ip_setttl()
153 return (-1); in ip_setttl()
178 if (fetch_ip() == -1) in op_ip()
181 switch (value->var.subs[sub - 1]) { in op_ip()
184 ctx->scratch->int1 = ip_forwarding ? 1 : 2; in op_ip()
185 ctx->scratch->int2 = value->v.integer; in op_ip()
186 if (value->v.integer == 1) { in op_ip()
187 if (!ip_forwarding && ip_forward(1, &old)) in op_ip()
189 ctx->scratch->int1 = old ? 1 : 2; in op_ip()
190 } else if (value->v.integer == 2) { in op_ip()
200 ctx->scratch->int2 = value->v.integer; in op_ip()
201 if (value->v.integer < 1 || value->v.integer > 255) in op_ip()
203 if (ip_defttl != value->v.integer && in op_ip()
204 ip_setttl(value->v.integer, &old)) in op_ip()
212 switch (value->var.subs[sub - 1]) { in op_ip()
215 if (ctx->scratch->int1 == 1) { in op_ip()
217 (void)ip_forward(1, NULL); in op_ip()
219 if (ctx->scratch->int2 == 1) in op_ip()
236 if (fetch_ip() == -1) in op_ip()
239 switch (value->var.subs[sub - 1]) { in op_ip()
242 value->v.integer = ip_forwarding ? 1 : 2; in op_ip()
246 value->v.integer = ip_defttl; in op_ip()
278 switch (value->var.subs[sub - 1]) { in op_ipstat()
281 value->v.uint32 = ipstat.ips_total; in op_ipstat()
285 value->v.uint32 = ipstat.ips_badsum + ipstat.ips_tooshort in op_ipstat()
292 value->v.uint32 = ipstat.ips_cantforward; in op_ipstat()
296 value->v.uint32 = ipstat.ips_forward; in op_ipstat()
300 value->v.uint32 = ipstat.ips_noproto; in op_ipstat()
304 value->v.uint32 = ip_idrop; in op_ipstat()
308 value->v.uint32 = ipstat.ips_delivered; in op_ipstat()
312 value->v.uint32 = ipstat.ips_localout; in op_ipstat()
316 value->v.uint32 = ipstat.ips_odropped; in op_ipstat()
320 value->v.uint32 = ipstat.ips_noroute; in op_ipstat()
324 value->v.integer = ip_fragttl; in op_ipstat()
328 value->v.uint32 = ipstat.ips_fragments; in op_ipstat()
332 value->v.uint32 = ipstat.ips_reassembled; in op_ipstat()
336 value->v.uint32 = ipstat.ips_fragdropped in op_ipstat()
341 value->v.uint32 = ipstat.ips_fragmented; in op_ipstat()
345 value->v.uint32 = ipstat.ips_cantfrag; in op_ipstat()
349 value->v.uint32 = ipstat.ips_ofragments; in op_ipstat()
383 switch (value->var.subs[sub - 1]) { in op_icmpstat()
386 value->v.integer = 0; in op_icmpstat()
388 value->v.integer += icmpstat.icps_inhist[i]; in op_icmpstat()
389 value->v.integer += icmpstat.icps_tooshort + in op_icmpstat()
395 value->v.integer = icmpstat.icps_tooshort + in op_icmpstat()
404 value->v.integer = icmpstat.icps_inhist[ICMP_UNREACH]; in op_icmpstat()
408 value->v.integer = icmpstat.icps_inhist[ICMP_TIMXCEED]; in op_icmpstat()
412 value->v.integer = icmpstat.icps_inhist[ICMP_PARAMPROB]; in op_icmpstat()
416 value->v.integer = icmpstat.icps_inhist[ICMP_SOURCEQUENCH]; in op_icmpstat()
420 value->v.integer = icmpstat.icps_inhist[ICMP_REDIRECT]; in op_icmpstat()
424 value->v.integer = icmpstat.icps_inhist[ICMP_ECHO]; in op_icmpstat()
428 value->v.integer = icmpstat.icps_inhist[ICMP_ECHOREPLY]; in op_icmpstat()
432 value->v.integer = icmpstat.icps_inhist[ICMP_TSTAMP]; in op_icmpstat()
436 value->v.integer = icmpstat.icps_inhist[ICMP_TSTAMPREPLY]; in op_icmpstat()
440 value->v.integer = icmpstat.icps_inhist[ICMP_MASKREQ]; in op_icmpstat()
444 value->v.integer = icmpstat.icps_inhist[ICMP_MASKREPLY]; in op_icmpstat()
448 value->v.integer = 0; in op_icmpstat()
450 value->v.integer += icmpstat.icps_outhist[i]; in op_icmpstat()
451 value->v.integer += icmpstat.icps_badaddr + in op_icmpstat()
456 value->v.integer = icmpstat.icps_badaddr + in op_icmpstat()
461 value->v.integer = icmpstat.icps_outhist[ICMP_UNREACH]; in op_icmpstat()
465 value->v.integer = icmpstat.icps_outhist[ICMP_TIMXCEED]; in op_icmpstat()
469 value->v.integer = icmpstat.icps_outhist[ICMP_PARAMPROB]; in op_icmpstat()
473 value->v.integer = icmpstat.icps_outhist[ICMP_SOURCEQUENCH]; in op_icmpstat()
477 value->v.integer = icmpstat.icps_outhist[ICMP_REDIRECT]; in op_icmpstat()
481 value->v.integer = icmpstat.icps_outhist[ICMP_ECHO]; in op_icmpstat()
485 value->v.integer = icmpstat.icps_outhist[ICMP_ECHOREPLY]; in op_icmpstat()
489 value->v.integer = icmpstat.icps_outhist[ICMP_TSTAMP]; in op_icmpstat()
493 value->v.integer = icmpstat.icps_outhist[ICMP_TSTAMPREPLY]; in op_icmpstat()
497 value->v.integer = icmpstat.icps_outhist[ICMP_MASKREQ]; in op_icmpstat()
501 value->v.integer = icmpstat.icps_outhist[ICMP_MASKREPLY]; in op_icmpstat()