Home | History | Annotate | Download | only in tests

Lines Matching refs:packet

48 /* @brief Add the given option data to a DHCPv4 packet
50 * It first fills the packet.options buffer with the given pad character.
54 * @param packet pointer to the packet
55 * @param data pointer to the option data to copy into the packet's options
58 * @param pad byte value with which to initialize the packet's options buffer
60 * @return returns the new length of the packet
62 unsigned set_packet_options(struct dhcp_packet *packet,
66 memset(packet->options, pad, DHCP_MAX_OPTION_LEN);
70 memcpy(packet->options, DHCP_OPTIONS_COOKIE, new_len);
77 memcpy(&packet->options[4], data, len);
89 * @param actual_options pointer to the packet::options to be checked
93 * @param pad byte value with which to initialize the packet's options buffer
128 struct dhcp_packet packet;
134 memset(&packet, 0x0, sizeof(packet));
137 /* Make sure an empty packet is harmless. We set add_agent_options = 1
140 ret = strip_relay_agent_options(&ifaces, &matched, &packet, len);
142 atf_tc_fail("empty packet failed");
180 len = set_packet_options(&packet, input_data, sizeof(input_data), pad);
187 ret = strip_relay_agent_options(&ifaces, &matched, &packet, len);
192 if (check_with_pad(packet.options, input_data, sizeof(input_data),
204 ret = strip_relay_agent_options(&ifaces, &matched, &packet, len);
210 if (check_with_pad(packet.options, output_data, sizeof(output_data),
216 len = set_packet_options(&packet, input_data2, sizeof(input_data2), pad);
224 ret = strip_relay_agent_options(&ifaces, &matched, &packet, len);
230 if (check_with_pad(packet.options, output_data, sizeof(output_data),
237 /* Verify that oversized packet filled with long options does not
242 unsigned char packbuf [4095]; /* Packet input buffer.
245 struct dhcp_packet packet;
260 len = set_packet_options(&u.packet, input_data, sizeof(input_data), pad);
269 ret = strip_relay_agent_options(&ifaces, &matched, &u.packet, 4095);
286 struct dhcp_packet packet;
302 memset(&packet, 0x0, sizeof(packet));
305 /* Make sure an empty packet is harmless */
306 ret = add_relay_agent_options(&ifc, &packet, len, giaddr);
308 atf_tc_fail("empty packet failed");
350 len = set_packet_options(&packet, input_data, sizeof(input_data), pad);
357 ret = add_relay_agent_options(&ifc, &packet, len, giaddr);
362 if (check_with_pad(packet.options, input_data, sizeof(input_data),
374 ret = add_relay_agent_options(&ifc, &packet, len, giaddr);
380 if (check_with_pad(packet.options, output_data, sizeof(output_data),
386 len = set_packet_options(&packet, input_data2, sizeof(input_data2),
395 ret = add_relay_agent_options(&ifc, &packet, len, giaddr);
401 if (check_with_pad(packet.options, output_data, sizeof(output_data),