Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dhcp_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
* @file dhcp_device.cpp
*/

#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <libexplain/ioctl.h>
#include <ifaddrs.h>
#include <pcap.h>
#include <syslog.h>
#include <unordered_map>
#include <unordered_set>

#include "dhcp_device.h"

Expand Down
2 changes: 1 addition & 1 deletion src/dhcp_devman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

#include <assert.h>
#include <errno.h>
#include <memory>
#include <string.h>
#include <syslog.h>
#include <stdlib.h>
Expand Down
1 change: 0 additions & 1 deletion src/dhcp_devman.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#ifndef DHCP_DEVMAN_H_
#define DHCP_DEVMAN_H_

#include <stdint.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
Expand Down
6 changes: 5 additions & 1 deletion src/dhcp_mon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@
*/

#include <signal.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <assert.h>
#include <chrono>
#include <algorithm>
#include <event2/thread.h>
#include <memory>
#include <mutex>
#include <string>
#include <unordered_set>

#include "dhcp_mon.h"

Expand Down
2 changes: 2 additions & 0 deletions src/dhcp_mon.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef DHCP_MON_H_
#define DHCP_MON_H_

#include <stddef.h>

/** dhcpmon debug mode control flag, mostly used for logging for more frequent operations */
extern bool debug_on;

Expand Down
7 changes: 2 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@
*
*/

#include <err.h>
#include <errno.h>
#include <libgen.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <semaphore.h>
#include <syslog.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <swss/subscriberstatetable.h>
#include <swss/select.h>

#include "dhcp_mon.h" // starting dhcpmon
#include "dhcp_devman.h" // for registering interfaces
Expand Down
3 changes: 3 additions & 0 deletions src/packet_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
* Implementation of packet handler functions
*/

#include <errno.h>
#include <net/ethernet.h>
#include <netinet/ether.h>
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <string.h>
#include <vector>

#include "packet_handler.h"

Expand Down
2 changes: 1 addition & 1 deletion src/packet_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef PACKET_HANDLER_H_
#define PACKET_HANDLER_H_

#include <string.h>
#include <string>
#include <unistd.h>
#include <net/ethernet.h>
#include <netinet/ip.h>
Expand Down
2 changes: 2 additions & 0 deletions src/sock_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* @file socket_manager.cpp
*/

#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <memory>
#include <string.h>
#include <syslog.h>
#include <stdlib.h>
Expand Down
1 change: 1 addition & 0 deletions src/sock_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef SOCKET_MANAGER_H_
#define SOCKET_MANAGER_H_

#include <stddef.h>
#include <stdint.h>
#include <string>
#include <unordered_map>
Expand Down
5 changes: 4 additions & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include <arpa/inet.h>
#include <syslog.h>
#include <exception>
#include <memory>
#include <stdio.h>
#include <stdlib.h>

#include "util.h"
#include <swss/subscriberstatetable.h>
Expand Down
8 changes: 5 additions & 3 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
#ifndef UTIL_H
#define UTIL_H

#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <string>
#include <memory>
#include <string.h>
#include <utility>
#include <jsoncpp/json/json.h>
#include <syslog.h>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <functional>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/ip6.h>
#include <event2/event.h>

#define COUNTERS_DB_COUNTER_TABLE_PREFIX "DHCPV4_COUNTER_TABLE:"
#define COUNTERS_DB_COUNTER_TABLE_V6_PREFIX "DHCPV6_COUNTER_TABLE:"
Expand Down