• Home
  • Raw
  • Download

Lines Matching refs:opt

47 dhcp_print_option_encoding(const struct dhcp_opt *opt, int cols)  in dhcp_print_option_encoding()  argument
55 if (opt->type & EMBED) in dhcp_print_option_encoding()
57 if (opt->type & ENCAP) in dhcp_print_option_encoding()
59 if (opt->type & INDEX) in dhcp_print_option_encoding()
61 if (opt->type & ARRAY) in dhcp_print_option_encoding()
63 if (opt->type & UINT8) in dhcp_print_option_encoding()
65 else if (opt->type & UINT16) in dhcp_print_option_encoding()
67 else if (opt->type & SINT16) in dhcp_print_option_encoding()
69 else if (opt->type & UINT32) in dhcp_print_option_encoding()
71 else if (opt->type & SINT32) in dhcp_print_option_encoding()
73 else if (opt->type & ADDRIPV4) in dhcp_print_option_encoding()
75 else if (opt->type & ADDRIPV6) in dhcp_print_option_encoding()
77 else if (opt->type & FLAG) in dhcp_print_option_encoding()
79 else if (opt->type & RFC3397) in dhcp_print_option_encoding()
81 else if (opt->type & DOMAIN) in dhcp_print_option_encoding()
83 else if (opt->type & ASCII) in dhcp_print_option_encoding()
85 else if (opt->type & RAW) in dhcp_print_option_encoding()
87 else if (opt->type & BINHEX) in dhcp_print_option_encoding()
89 else if (opt->type & STRING) in dhcp_print_option_encoding()
91 if (opt->type & RFC3361) in dhcp_print_option_encoding()
93 if (opt->type & RFC3442) in dhcp_print_option_encoding()
95 if (opt->type & RFC5969) in dhcp_print_option_encoding()
97 if (opt->type & REQUEST) in dhcp_print_option_encoding()
99 if (opt->type & NOREQ) in dhcp_print_option_encoding()
109 struct dhcp_opt *opt; in vivso_find() local
112 for (i = 0, opt = ifp->options->vivso_override; in vivso_find()
114 i++, opt++) in vivso_find()
115 if (opt->option == iana_en) in vivso_find()
116 return opt; in vivso_find()
117 for (i = 0, opt = ifp->ctx->vivso; in vivso_find()
119 i++, opt++) in vivso_find()
120 if (opt->option == iana_en) in vivso_find()
121 return opt; in vivso_find()
156 const struct dhcp_opt *opt; in make_option_mask() local
168 for (i = 0, opt = odopts; i < odopts_len; i++, opt++) { in make_option_mask()
169 if (strcmp(opt->var, token) == 0) in make_option_mask()
174 if (e == 0 && opt->option == n) in make_option_mask()
181 for (i = 0, opt = dopts; i < dopts_len; i++, opt++) { in make_option_mask()
182 if (strcmp(opt->var, token) == 0) in make_option_mask()
187 if (e == 0 && opt->option == n) in make_option_mask()
194 if (!match || !opt->option) { in make_option_mask()
199 if (add == 2 && !(opt->type & ADDRIPV4)) { in make_option_mask()
205 add_option_mask(mask, opt->option); in make_option_mask()
207 del_option_mask(mask, opt->option); in make_option_mask()
527 dhcp_optlen(const struct dhcp_opt *opt, size_t dl) in dhcp_optlen() argument
531 if (opt->type & ADDRIPV6) in dhcp_optlen()
533 else if (opt->type & (UINT32 | ADDRIPV4)) in dhcp_optlen()
535 else if (opt->type & UINT16) in dhcp_optlen()
537 else if (opt->type & (UINT8 | BITFLAG)) in dhcp_optlen()
539 else if (opt->type & FLAG) in dhcp_optlen()
543 if (opt->len) { in dhcp_optlen()
544 if ((size_t)opt->len > dl) { in dhcp_optlen()
548 return (ssize_t)opt->len; in dhcp_optlen()
559 if (opt->type & ARRAY) in dhcp_optlen()
754 const struct dhcp_opt *opt, int vname, const uint8_t *od, size_t ol, in dhcp_envoption1() argument
762 ol = (size_t)dhcp_optlen(opt, ol); in dhcp_envoption1()
766 len = print_option(NULL, 0, opt->type, od, ol, ifname); in dhcp_envoption1()
770 e = strlen(opt->var) + 1; in dhcp_envoption1()
784 v += snprintf(val, e, "%s_%s=", prefix, opt->var); in dhcp_envoption1()
788 print_option(v, (size_t)len + 1, opt->type, od, ol, ifname); in dhcp_envoption1()
794 const char *ifname, struct dhcp_opt *opt, in dhcp_envoption() argument
808 if (opt->embopts_len == 0 && opt->encopts_len == 0) { in dhcp_envoption()
810 prefix, opt, 1, od, ol, ifname)) in dhcp_envoption()
817 if (opt->type & INDEX) { in dhcp_envoption()
818 if (opt->index > 999) { in dhcp_envoption()
824 e = strlen(prefix) + strlen(opt->var) + 2 + in dhcp_envoption()
825 (opt->type & INDEX ? 3 : 0); in dhcp_envoption()
831 if (opt->type & INDEX) in dhcp_envoption()
833 opt->var, ++opt->index); in dhcp_envoption()
835 snprintf(pfx, e, "%s_%s", prefix, opt->var); in dhcp_envoption()
842 for (i = 0, eopt = opt->embopts; i < opt->embopts_len; i++, eopt++) { in dhcp_envoption()
852 if (ol != 0 || i + 1 < opt->embopts_len) in dhcp_envoption()
855 ifname, __func__, opt->option); in dhcp_envoption()
861 ov = strcmp(opt->var, eopt->var); in dhcp_envoption()
870 if (opt->encopts_len && ol > 0) { in dhcp_envoption()
874 for (i = 0, eopt = opt->encopts; in dhcp_envoption()
875 i < opt->encopts_len; in dhcp_envoption()
878 eoc = opt->option; in dhcp_envoption()
887 for (i = 0, eopt = opt->encopts; in dhcp_envoption()
888 i < opt->encopts_len; in dhcp_envoption()
919 dhcp_zero_index(struct dhcp_opt *opt) in dhcp_zero_index() argument
924 opt->index = 0; in dhcp_zero_index()
925 for (i = 0, o = opt->embopts; i < opt->embopts_len; i++, o++) in dhcp_zero_index()
927 for (i = 0, o = opt->encopts; i < opt->encopts_len; i++, o++) in dhcp_zero_index()