Home | History | Annotate | Download | only in lib

Lines Matching refs:opt

12  * Unpack DHCP options from a field.  Assumes opt is pre-initalized
16 struct dhcp_option opt[256])
34 if (opt[op].len < 0)
35 opt[op].len = 0;
37 opt[op].data = realloc(opt[op].data,
38 opt[op].len + xlen + 1);
39 if (!opt[op].data) {
43 memcpy((char *)opt[op].data + opt[op].len, p, xlen);
44 opt[op].len += xlen;
46 *((char *)opt[op].data + opt[op].len) = 0;
60 struct dhcp_option opt[256])
71 opt[i].len = -1; /* Option not present */
72 opt[i].data = NULL;
75 err = dhcp_unpack_field(pkt->options, len-240, opt);
78 if (opt[52].len == 1) {
79 overload = *(uint8_t *)opt[52].data;
80 free(opt[52].data);
81 opt[52].len = -1;
82 opt[52].data = NULL;
86 err |= dhcp_unpack_field(pkt->file, 128, opt);
88 opt[67].len = strnlen((const char *)pkt->file, 128);
89 if (opt[67].len) {
90 opt[67].data = malloc(opt[67].len + 1);
91 if (opt[67].data) {
92 memcpy(opt[67].data, pkt->file, opt[67].len);
93 *((char *)opt[67].data + opt[67].len) = 0;
101 err |= dhcp_unpack_field(pkt->sname, 64, opt);
103 opt[66].len = strnlen((const char *)pkt->sname, 64);
104 if (opt[66].len) {
105 opt[66].data = malloc(opt[66].len + 1);
106 if (opt[66].data) {
107 memcpy(opt[66].data, pkt->file, opt[66].len);
108 *((char *)opt[66].data + opt[66].len) = 0;