Smart Home firewall
Profile-based Smart Home firewall
Functions
dhcp.c File Reference

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>
Include dependency graph for dhcp.c:

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[])
 

Detailed Description

Unit tests for the DHCP parser.

Date
2022-09-12

Function Documentation

◆ compare_headers()

void compare_headers ( dhcp_message_t  actual,
dhcp_message_t  expected 
)

Compare the headers of two DHCP messages.

Parameters
actualactual DHCP message
expectedexpected DHCP message

◆ compare_options()

void compare_options ( dhcp_options_t  actual,
dhcp_options_t  expected 
)

Compare two DHCP options lists.

Parameters
actualactual DHCP options list
expectedexpected DHCP options list

◆ main()

int main ( int  argc,
char const *  argv[] 
)

Main function for the unit tests.

◆ test_dhcp_discover()

void test_dhcp_discover ( )

DHCP Unit test, with a DHCP Discover message.

◆ test_dhcp_offer()

void test_dhcp_offer ( )

DHCP Unit test, with a DHCP Offer message.