Home | History | Annotate | Download | only in extensions

Lines Matching defs:tos

1 /* Shared library add-on to iptables to add TOS target support. */
13 struct ipt_tos_target_info tos;
16 /* TOS names and values. */
20 unsigned char TOS;
37 "TOS target v%s options:\n"
38 " --set-tos value Set Type of Service field to one of the\n"
45 TOS_values[i].TOS,
46 TOS_values[i].TOS);
51 { "set-tos", 1, 0, '1' },
64 unsigned int i, tos;
66 if (string_to_number(s, 0, 255, &tos) != -1) {
67 if (tos == IPTOS_LOWDELAY
68 || tos == IPTOS_THROUGHPUT
69 || tos == IPTOS_RELIABILITY
70 || tos == IPTOS_MINCOST
71 || tos == IPTOS_NORMALSVC) {
72 info->tos = (u_int8_t )tos;
78 info->tos = TOS_values[i].TOS;
82 exit_error(PARAMETER_PROBLEM, "Bad TOS value `%s'", s);
99 "TOS target: Cant specify --set-tos twice");
116 "TOS target: Parameter --set-tos is required");
120 print_tos(u_int8_t tos, int numeric)
126 if (TOS_values[i].TOS == tos) {
131 printf("0x%02x ", tos);
142 printf("TOS set ");
143 print_tos(tosinfo->tos, numeric);
153 printf("--set-tos 0x%02x ", tosinfo->tos);
156 static struct iptables_target tos = {
158 .name = "TOS",
173 register_target(&tos);