Lines Matching defs:opt

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