Lines Matching refs:opt

73 } opt = {  variable
118 opt.silent_send = true; in cs_parse_args()
121 opt.size = atoi(optarg); in cs_parse_args()
124 opt.sock.family = AF_INET; in cs_parse_args()
127 opt.sock.family = AF_INET6; in cs_parse_args()
131 opt.sock.proto = IPPROTO_UDP; in cs_parse_args()
133 opt.sock.proto = IPPROTO_ICMP; in cs_parse_args()
135 opt.sock.type = SOCK_RAW; in cs_parse_args()
143 opt.mark.ena = true; in cs_parse_args()
144 opt.mark.val = atoi(optarg); in cs_parse_args()
147 opt.sockopt.mark = atoi(optarg); in cs_parse_args()
150 opt.txtime.ena = true; in cs_parse_args()
151 opt.txtime.delay = atoi(optarg); in cs_parse_args()
154 opt.ts.ena = true; in cs_parse_args()
157 opt.v6.dontfrag.ena = true; in cs_parse_args()
158 opt.v6.dontfrag.val = atoi(optarg); in cs_parse_args()
161 opt.sockopt.dontfrag = atoi(optarg); in cs_parse_args()
164 opt.v6.tclass.ena = true; in cs_parse_args()
165 opt.v6.tclass.val = atoi(optarg); in cs_parse_args()
168 opt.sockopt.tclass = atoi(optarg); in cs_parse_args()
171 opt.v6.hlimit.ena = true; in cs_parse_args()
172 opt.v6.hlimit.val = atoi(optarg); in cs_parse_args()
175 opt.sockopt.hlimit = atoi(optarg); in cs_parse_args()
178 opt.v6.exthdr.ena = true; in cs_parse_args()
181 opt.v6.exthdr.val = IPV6_HOPOPTS; in cs_parse_args()
184 opt.v6.exthdr.val = IPV6_DSTOPTS; in cs_parse_args()
187 opt.v6.exthdr.val = IPV6_RTHDRDSTOPTS; in cs_parse_args()
200 opt.host = argv[optind]; in cs_parse_args()
201 opt.service = argv[optind + 1]; in cs_parse_args()
246 SOL_SOCKET, SO_MARK, &opt.mark); in cs_write_cmsg()
248 SOL_IPV6, IPV6_DONTFRAG, &opt.v6.dontfrag); in cs_write_cmsg()
250 SOL_IPV6, IPV6_TCLASS, &opt.v6.tclass); in cs_write_cmsg()
252 SOL_IPV6, IPV6_HOPLIMIT, &opt.v6.hlimit); in cs_write_cmsg()
254 if (opt.txtime.ena) { in cs_write_cmsg()
266 opt.txtime.delay * 1000; in cs_write_cmsg()
278 if (opt.ts.ena) { in cs_write_cmsg()
297 if (opt.v6.exthdr.ena) { in cs_write_cmsg()
304 cmsg->cmsg_type = opt.v6.exthdr.val; in cs_write_cmsg()
336 if (!opt.ts.ena) in cs_read_cmsg()
397 if (opt.sockopt.mark && in ca_set_sockopts()
399 &opt.sockopt.mark, sizeof(opt.sockopt.mark))) in ca_set_sockopts()
401 if (opt.sockopt.dontfrag && in ca_set_sockopts()
403 &opt.sockopt.dontfrag, sizeof(opt.sockopt.dontfrag))) in ca_set_sockopts()
405 if (opt.sockopt.tclass && in ca_set_sockopts()
407 &opt.sockopt.tclass, sizeof(opt.sockopt.tclass))) in ca_set_sockopts()
409 if (opt.sockopt.hlimit && in ca_set_sockopts()
411 &opt.sockopt.hlimit, sizeof(opt.sockopt.hlimit))) in ca_set_sockopts()
427 buf = malloc(opt.size); in main()
428 memrnd(buf, opt.size); in main()
431 hints.ai_family = opt.sock.family; in main()
434 err = getaddrinfo(opt.host, opt.service, &hints, &ai); in main()
437 opt.host, opt.service); in main()
441 if (ai->ai_family == AF_INET6 && opt.sock.proto == IPPROTO_ICMP) in main()
442 opt.sock.proto = IPPROTO_ICMPV6; in main()
444 fd = socket(ai->ai_family, opt.sock.type, opt.sock.proto); in main()
451 if (opt.sock.proto == IPPROTO_ICMP) { in main()
454 } else if (opt.sock.proto == IPPROTO_ICMPV6) { in main()
457 } else if (opt.sock.type == SOCK_RAW) { in main()
458 struct udphdr hdr = { 1, 2, htons(opt.size), 0 }; in main()
462 sin6->sin6_port = htons(opt.sock.proto); in main()
473 iov[0].iov_len = opt.size; in main()
485 if (!opt.silent_send) in main()
489 } else if (err != (int)opt.size) { in main()
498 usleep(opt.txtime.delay); in main()