Lines Matching full:opt
76 } opt = { variable
124 opt.silent_send = true; in cs_parse_args()
127 opt.size = atoi(optarg); in cs_parse_args()
130 opt.sock.family = AF_INET; in cs_parse_args()
133 opt.sock.family = AF_INET6; in cs_parse_args()
137 opt.sock.proto = IPPROTO_UDP; in cs_parse_args()
139 opt.sock.proto = IPPROTO_ICMP; in cs_parse_args()
141 opt.sock.type = SOCK_RAW; in cs_parse_args()
148 opt.sockopt.priority = atoi(optarg); in cs_parse_args()
151 opt.mark.ena = true; in cs_parse_args()
152 opt.mark.val = atoi(optarg); in cs_parse_args()
155 opt.priority.ena = true; in cs_parse_args()
156 opt.priority.val = atoi(optarg); in cs_parse_args()
159 opt.sockopt.mark = atoi(optarg); in cs_parse_args()
162 opt.num_pkt = atoi(optarg); in cs_parse_args()
165 opt.txtime.ena = true; in cs_parse_args()
166 opt.txtime.delay = atoi(optarg); in cs_parse_args()
169 opt.ts.ena = true; in cs_parse_args()
172 opt.v6.dontfrag.ena = true; in cs_parse_args()
173 opt.v6.dontfrag.val = atoi(optarg); in cs_parse_args()
176 opt.sockopt.dontfrag = atoi(optarg); in cs_parse_args()
179 opt.v6.tclass.ena = true; in cs_parse_args()
180 opt.v6.tclass.val = atoi(optarg); in cs_parse_args()
183 opt.sockopt.tclass = atoi(optarg); in cs_parse_args()
186 opt.v6.hlimit.ena = true; in cs_parse_args()
187 opt.v6.hlimit.val = atoi(optarg); in cs_parse_args()
190 opt.sockopt.hlimit = atoi(optarg); in cs_parse_args()
193 opt.v6.exthdr.ena = true; in cs_parse_args()
196 opt.v6.exthdr.val = IPV6_HOPOPTS; in cs_parse_args()
199 opt.v6.exthdr.val = IPV6_DSTOPTS; in cs_parse_args()
202 opt.v6.exthdr.val = IPV6_RTHDRDSTOPTS; in cs_parse_args()
215 opt.host = argv[optind]; in cs_parse_args()
216 opt.service = argv[optind + 1]; in cs_parse_args()
261 SOL_SOCKET, SO_MARK, &opt.mark); in cs_write_cmsg()
263 SOL_SOCKET, SO_PRIORITY, &opt.priority); in cs_write_cmsg()
265 SOL_IPV6, IPV6_DONTFRAG, &opt.v6.dontfrag); in cs_write_cmsg()
267 SOL_IPV6, IPV6_TCLASS, &opt.v6.tclass); in cs_write_cmsg()
269 SOL_IPV6, IPV6_HOPLIMIT, &opt.v6.hlimit); in cs_write_cmsg()
271 if (opt.txtime.ena) { in cs_write_cmsg()
276 opt.txtime.delay * 1000; in cs_write_cmsg()
288 if (opt.ts.ena) { in cs_write_cmsg()
300 if (opt.v6.exthdr.ena) { in cs_write_cmsg()
307 cmsg->cmsg_type = opt.v6.exthdr.val; in cs_write_cmsg()
340 if (!opt.ts.ena) in cs_read_cmsg()
404 if (opt.sockopt.mark && in ca_set_sockopts()
406 &opt.sockopt.mark, sizeof(opt.sockopt.mark))) in ca_set_sockopts()
408 if (opt.sockopt.dontfrag && in ca_set_sockopts()
410 &opt.sockopt.dontfrag, sizeof(opt.sockopt.dontfrag))) in ca_set_sockopts()
412 if (opt.sockopt.tclass && in ca_set_sockopts()
414 &opt.sockopt.tclass, sizeof(opt.sockopt.tclass))) in ca_set_sockopts()
416 if (opt.sockopt.hlimit && in ca_set_sockopts()
418 &opt.sockopt.hlimit, sizeof(opt.sockopt.hlimit))) in ca_set_sockopts()
420 if (opt.sockopt.priority && in ca_set_sockopts()
422 &opt.sockopt.priority, sizeof(opt.sockopt.priority))) in ca_set_sockopts()
425 if (opt.txtime.ena) { in ca_set_sockopts()
434 if (opt.ts.ena) { in ca_set_sockopts()
457 buf = malloc(opt.size); in main()
458 memrnd(buf, opt.size); in main()
461 hints.ai_family = opt.sock.family; in main()
464 err = getaddrinfo(opt.host, opt.service, &hints, &ai); in main()
467 opt.host, opt.service); in main()
471 if (ai->ai_family == AF_INET6 && opt.sock.proto == IPPROTO_ICMP) in main()
472 opt.sock.proto = IPPROTO_ICMPV6; in main()
474 fd = socket(ai->ai_family, opt.sock.type, opt.sock.proto); in main()
481 if (opt.sock.proto == IPPROTO_ICMP) { in main()
484 } else if (opt.sock.proto == IPPROTO_ICMPV6) { in main()
487 } else if (opt.sock.type == SOCK_RAW) { in main()
488 struct udphdr hdr = { 1, 2, htons(opt.size), 0 }; in main()
492 sin6->sin6_port = htons(opt.sock.proto); in main()
503 iov[0].iov_len = opt.size; in main()
513 for (i = 0; i < opt.num_pkt; i++) { in main()
516 if (!opt.silent_send) in main()
520 } else if (err != (int)opt.size) { in main()
528 if (opt.ts.ena) { in main()
537 usleep(opt.txtime.delay / 20); in main()