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