Lines Matching full:opt

75 } opt = {  variable
121 opt.silent_send = true; in cs_parse_args()
124 opt.size = atoi(optarg); in cs_parse_args()
127 opt.sock.family = AF_INET; in cs_parse_args()
130 opt.sock.family = AF_INET6; in cs_parse_args()
134 opt.sock.proto = IPPROTO_UDP; in cs_parse_args()
136 opt.sock.proto = IPPROTO_ICMP; in cs_parse_args()
138 opt.sock.type = SOCK_RAW; in cs_parse_args()
145 opt.sockopt.priority = atoi(optarg); in cs_parse_args()
148 opt.mark.ena = true; in cs_parse_args()
149 opt.mark.val = atoi(optarg); in cs_parse_args()
152 opt.sockopt.mark = atoi(optarg); in cs_parse_args()
155 opt.num_pkt = atoi(optarg); in cs_parse_args()
158 opt.txtime.ena = true; in cs_parse_args()
159 opt.txtime.delay = atoi(optarg); in cs_parse_args()
162 opt.ts.ena = true; in cs_parse_args()
165 opt.v6.dontfrag.ena = true; in cs_parse_args()
166 opt.v6.dontfrag.val = atoi(optarg); in cs_parse_args()
169 opt.sockopt.dontfrag = atoi(optarg); in cs_parse_args()
172 opt.v6.tclass.ena = true; in cs_parse_args()
173 opt.v6.tclass.val = atoi(optarg); in cs_parse_args()
176 opt.sockopt.tclass = atoi(optarg); in cs_parse_args()
179 opt.v6.hlimit.ena = true; in cs_parse_args()
180 opt.v6.hlimit.val = atoi(optarg); in cs_parse_args()
183 opt.sockopt.hlimit = atoi(optarg); in cs_parse_args()
186 opt.v6.exthdr.ena = true; in cs_parse_args()
189 opt.v6.exthdr.val = IPV6_HOPOPTS; in cs_parse_args()
192 opt.v6.exthdr.val = IPV6_DSTOPTS; in cs_parse_args()
195 opt.v6.exthdr.val = IPV6_RTHDRDSTOPTS; in cs_parse_args()
208 opt.host = argv[optind]; in cs_parse_args()
209 opt.service = argv[optind + 1]; in cs_parse_args()
254 SOL_SOCKET, SO_MARK, &opt.mark); in cs_write_cmsg()
256 SOL_IPV6, IPV6_DONTFRAG, &opt.v6.dontfrag); in cs_write_cmsg()
258 SOL_IPV6, IPV6_TCLASS, &opt.v6.tclass); in cs_write_cmsg()
260 SOL_IPV6, IPV6_HOPLIMIT, &opt.v6.hlimit); in cs_write_cmsg()
262 if (opt.txtime.ena) { in cs_write_cmsg()
274 opt.txtime.delay * 1000; in cs_write_cmsg()
286 if (opt.ts.ena) { in cs_write_cmsg()
305 if (opt.v6.exthdr.ena) { in cs_write_cmsg()
312 cmsg->cmsg_type = opt.v6.exthdr.val; in cs_write_cmsg()
344 if (!opt.ts.ena) in cs_read_cmsg()
405 if (opt.sockopt.mark && in ca_set_sockopts()
407 &opt.sockopt.mark, sizeof(opt.sockopt.mark))) in ca_set_sockopts()
409 if (opt.sockopt.dontfrag && in ca_set_sockopts()
411 &opt.sockopt.dontfrag, sizeof(opt.sockopt.dontfrag))) in ca_set_sockopts()
413 if (opt.sockopt.tclass && in ca_set_sockopts()
415 &opt.sockopt.tclass, sizeof(opt.sockopt.tclass))) in ca_set_sockopts()
417 if (opt.sockopt.hlimit && in ca_set_sockopts()
419 &opt.sockopt.hlimit, sizeof(opt.sockopt.hlimit))) in ca_set_sockopts()
421 if (opt.sockopt.priority && in ca_set_sockopts()
423 &opt.sockopt.priority, sizeof(opt.sockopt.priority))) in ca_set_sockopts()
440 buf = malloc(opt.size); in main()
441 memrnd(buf, opt.size); in main()
444 hints.ai_family = opt.sock.family; in main()
447 err = getaddrinfo(opt.host, opt.service, &hints, &ai); in main()
450 opt.host, opt.service); in main()
454 if (ai->ai_family == AF_INET6 && opt.sock.proto == IPPROTO_ICMP) in main()
455 opt.sock.proto = IPPROTO_ICMPV6; in main()
457 fd = socket(ai->ai_family, opt.sock.type, opt.sock.proto); in main()
464 if (opt.sock.proto == IPPROTO_ICMP) { in main()
467 } else if (opt.sock.proto == IPPROTO_ICMPV6) { in main()
470 } else if (opt.sock.type == SOCK_RAW) { in main()
471 struct udphdr hdr = { 1, 2, htons(opt.size), 0 }; in main()
475 sin6->sin6_port = htons(opt.sock.proto); in main()
486 iov[0].iov_len = opt.size; in main()
496 for (i = 0; i < opt.num_pkt; i++) { in main()
499 if (!opt.silent_send) in main()
503 } else if (err != (int)opt.size) { in main()
511 if (opt.ts.ena) { in main()
513 usleep(opt.txtime.delay); in main()