Smart Home firewall
Profile-based Smart Home firewall
|
Unit tests for the DHCP parser. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "packet_utils.h"
#include "header.h"
#include "dhcp.h"
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
Functions | |
void | compare_headers (dhcp_message_t actual, dhcp_message_t expected) |
Compare the headers of two DHCP messages. More... | |
void | compare_options (dhcp_options_t actual, dhcp_options_t expected) |
Compare two DHCP options lists. More... | |
void | test_dhcp_discover () |
void | test_dhcp_offer () |
int | main (int argc, char const *argv[]) |
Unit tests for the DHCP parser.
void compare_headers | ( | dhcp_message_t | actual, |
dhcp_message_t | expected | ||
) |
Compare the headers of two DHCP messages.
actual | actual DHCP message |
expected | expected DHCP message |
void compare_options | ( | dhcp_options_t | actual, |
dhcp_options_t | expected | ||
) |
Compare two DHCP options lists.
actual | actual DHCP options list |
expected | expected DHCP options list |
int main | ( | int | argc, |
char const * | argv[] | ||
) |
Main function for the unit tests.
void test_dhcp_discover | ( | ) |
DHCP Unit test, with a DHCP Discover message.
void test_dhcp_offer | ( | ) |
DHCP Unit test, with a DHCP Offer message.