Lines Matching refs:entry
30 ((void *)((char *)(cb)->data + (cb)->entry->ptroff))
75 const struct xt_option_entry *entry, unsigned int *offset)
80 if (entry == NULL)
87 for (num_new = 0; entry[num_new].name != NULL; ++num_new)
109 for (i = 0; i < num_new; ++i, ++mp, ++entry) {
110 mp->name = entry->name;
111 mp->has_arg = entry->type != XTTYPE_NONE;
113 mp->val = entry->id + *offset;
121 /* Clear trailing entry */
174 const struct xt_option_entry *entry = cb->entry;
175 uintmax_t lmin = 0, lmax = xtopt_max_by_type(entry->type);
178 if (cb->entry->min != 0)
179 lmin = cb->entry->min;
180 if (cb->entry->max != 0)
181 lmax = cb->entry->max;
187 cb->ext_name, entry->name, lmin, lmax);
189 if (entry->type == XTTYPE_UINT8) {
191 if (entry->flags & XTOPT_PUT)
193 } else if (entry->type == XTTYPE_UINT16) {
195 if (entry->flags & XTOPT_PUT)
197 } else if (entry->type == XTTYPE_UINT32) {
199 if (entry->flags & XTOPT_PUT)
201 } else if (entry->type == XTTYPE_UINT64) {
203 if (entry->flags & XTOPT_PUT)
213 const struct xt_option_entry *entry = cb->entry;
219 (entry->min != entry->max &&
220 (value < entry->min || value > entry->max)))
224 cb->ext_name, entry->name, entry->min, entry->max);
227 if (entry->flags & XTOPT_PUT)
232 * Copy the parsed value to the appropriate entry in cb->val.
236 const struct xt_option_entry *entry = cb->entry;
240 if (entry->type == XTTYPE_UINT8RC)
242 else if (entry->type == XTTYPE_UINT16RC)
244 else if (entry->type == XTTYPE_UINT32RC)
246 else if (entry->type == XTTYPE_UINT64RC)
256 const struct xt_option_entry *entry = cb->entry;
259 if (!(entry->flags & XTOPT_PUT))
261 if (entry->type == XTTYPE_UINT8RC)
263 else if (entry->type == XTTYPE_UINT16RC)
265 else if (entry->type == XTTYPE_UINT32RC)
267 else if (entry->type == XTTYPE_UINT64RC)
269 data += xtopt_esize_by_type(entry->type);
284 const struct xt_option_entry *entry = cb->entry;
286 size_t esize = xtopt_esize_by_type(entry->type);
287 const uintmax_t lmax = xtopt_max_by_type(entry->type);
294 maxiter = entry->size / esize;
297 if (entry->size % esize != 0)
306 cb->ext_name, entry->name, maxiter);
316 cb->ext_name, entry->name, arg, lmax);
321 cb->ext_name, entry->name, end);
333 const struct xt_option_entry *entry = cb->entry;
337 if (entry->min != 0 && z < entry->min)
340 "%u characters\n", entry->min);
341 if (entry->max != 0 && z > entry->max)
344 "%u characters\n", entry->max);
345 if (!(entry->flags & XTOPT_PUT))
347 if (z >= entry->size)
348 z = entry->size - 1;
415 cb->val.tos_mask = cb->entry->max;
438 cb->ext_name, cb->entry->name);
444 cb->ext_name, cb->entry->name);
449 cb->ext_name, cb->entry->name);
457 const struct syslog_level *entry = b;
459 return strcmp(name, entry->name);
487 if (cb->entry->flags & XTOPT_PUT)
547 if (cb->entry->flags & XTOPT_PUT)
590 if (cb->entry->flags & XTOPT_PUT)
600 const struct xt_option_entry *entry = cb->entry;
608 if (entry->flags & XTOPT_NBO)
611 if (entry->flags & XTOPT_PUT)
618 const struct xt_option_entry *entry = cb->entry;
627 maxiter = entry->size / esize;
630 if (entry->size % esize != 0)
642 cb->ext_name, entry->name, maxiter);
653 if (entry->flags & XTOPT_NBO)
664 if (entry->flags & XTOPT_PUT)
676 const struct xt_option_entry *entry = cb->entry;
684 cb->ext_name, entry->name, 0, cb->val.hlen);
696 const struct xt_option_entry *entry = cb->entry;
721 if (entry->flags & XTOPT_PUT)
768 if (cb->entry->flags & XTOPT_PUT)
807 const struct xt_option_entry *entry = cb->entry;
808 unsigned int eflag = 1 << cb->entry->id;
816 if ((!(entry->flags & XTOPT_MULTI) || (entry->excl & eflag)) &&
820 cb->ext_name, cb->entry->name);
821 if (cb->invert && !(entry->flags & XTOPT_INVERT))
824 cb->ext_name, entry->name);
825 if (entry->type != XTTYPE_NONE && optarg == NULL)
828 cb->ext_name, entry->name);
829 if (entry->type <= ARRAY_SIZE(xtopt_subparse) &&
830 xtopt_subparse[entry->type] != NULL)
831 xtopt_subparse[entry->type](cb);
833 cb->xflags |= 1 << entry->id;
842 const struct xt_option_entry *entry)
844 for (; entry->name != NULL; ++entry) {
845 if (entry->id >= CHAR_BIT * sizeof(unsigned int) ||
846 entry->id >= XT_OPTION_OFFSET_SCALE)
849 name, entry->id);
850 if (!(entry->flags & XTOPT_PUT))
852 if (entry->type >= ARRAY_SIZE(xtopt_psize) ||
853 xtopt_psize[entry->type] == 0)
855 "%s: entry type of option \"--%s\" cannot be "
857 name, entry->name);
858 if (xtopt_psize[entry->type] != -1 &&
859 xtopt_psize[entry->type] != entry->size)
863 name, entry->name,
864 xtopt_psize[entry->type], entry->size);
869 * Find an option entry by its id.
872 xtables_option_lookup(const struct xt_option_entry *entry, unsigned int id)
874 for (; entry->name != NULL; ++entry)
875 if (entry->id == id)
876 return entry;
900 cb.entry = xtables_option_lookup(t->x6_options, c);
901 if (cb.entry == NULL)
935 cb.entry = xtables_option_lookup(m->x6_options, c);
936 if (cb.entry == NULL)
952 * @entry: current option (from all ext's entries) being validated
957 xtables_option_fcheck2(const char *name, const struct xt_option_entry *entry,
961 unsigned int ef = 1 << entry->id, of = 1 << other->id;
963 if (entry->also & of && !(xflags & of))
966 name, entry->name, other->name);
968 if (!(entry->excl & of))
969 /* Use of entry does not collide with other option, good. */
977 name, entry->name, other->name);
983 * @entry: extension's option table
991 const struct xt_option_entry *entry, *other;
994 for (entry = table; entry->name != NULL; ++entry) {
995 if (entry->flags & XTOPT_MAND &&
996 !(xflags & (1 << entry->id)))
999 name, entry->name);
1000 if (!(xflags & (1 << entry->id)))
1004 for (i = 0; i < CHAR_BIT * sizeof(entry->id); ++i) {
1005 if (entry->id == i)
1014 xtables_option_fcheck2(name, entry, other, xflags);