-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dhcp-relay]: Add DHCP Relay Monitor (#3886)
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: #3886 signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
- Loading branch information
1 parent
3548587
commit 2658ab8
Showing
21 changed files
with
1,413 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SONiC DHCP MONitor package | ||
|
||
SONIC_DHCPMON_VERSION = 1.0.0-0 | ||
SONIC_DHCPMON_PKG_NAME = dhcpmon | ||
|
||
SONIC_DHCPMON = sonic-$(SONIC_DHCPMON_PKG_NAME)_$(SONIC_DHCPMON_VERSION)_$(CONFIGURED_ARCH).deb | ||
$(SONIC_DHCPMON)_SRC_PATH = $(SRC_PATH)/$(SONIC_DHCPMON_PKG_NAME) | ||
SONIC_DPKG_DEBS += $(SONIC_DHCPMON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
RM := rm -rf | ||
DHCPMON_TARGET := dhcpmon | ||
CP := cp | ||
MKDIR := mkdir | ||
CC := gcc | ||
MV := mv | ||
|
||
# All of the sources participating in the build are defined here | ||
-include src/subdir.mk | ||
-include objects.mk | ||
|
||
ifneq ($(MAKECMDGOALS),clean) | ||
ifneq ($(strip $(C_DEPS)),) | ||
-include $(C_DEPS) | ||
endif | ||
endif | ||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
|
||
# All Target | ||
all: sonic-dhcpmon | ||
|
||
# Tool invocations | ||
sonic-dhcpmon: $(OBJS) $(USER_OBJS) | ||
@echo 'Building target: $@' | ||
@echo 'Invoking: GCC C Linker' | ||
$(CC) -o "$(DHCPMON_TARGET)" $(OBJS) $(USER_OBJS) $(LIBS) | ||
@echo 'Finished building target: $@' | ||
@echo ' ' | ||
|
||
# Other Targets | ||
install: | ||
$(MKDIR) -p $(DESTDIR)/usr/sbin | ||
$(MV) $(DHCPMON_TARGET) $(DESTDIR)/usr/sbin | ||
|
||
deinstall: | ||
$(RM) $(DESTDIR)/usr/sbin/$(DHCPMON_TARGET) | ||
$(RM) -rf $(DESTDIR)/usr/sbin | ||
|
||
clean: | ||
-$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) $(DHCPMON_TARGET) | ||
-@echo ' ' | ||
|
||
.PHONY: all clean dependents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sonic-dhcpmon (1.0.0-0) UNRELEASED; urgency=medium | ||
|
||
* Initial release. | ||
|
||
-- Tamer Ahmed <tamer.ahmed@microsoft.com> Mon, 09 Dec 2019 12:00:00 -0700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Source: sonic-dhcpmon | ||
Section: devel | ||
Priority: optional | ||
Maintainer: Tamer Ahmed <tamer.ahmed@microsoft.com> | ||
Build-Depends: debhelper (>= 8.0.0), | ||
dh-systemd | ||
Standards-Version: 3.9.3 | ||
Homepage: https://github.com/Azure/sonic-buildimage | ||
XS-Go-Import-Path: github.com/Azure/sonic-buildimage | ||
|
||
Package: sonic-dhcpmon | ||
Architecture: any | ||
Built-Using: ${misc:Built-Using} | ||
Depends: libexplain51, | ||
libevent-2.0-5 | ||
Description: SONiC DHCP Monitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/make -f | ||
%: | ||
dh $@ --with systemd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
USER_OBJS := | ||
|
||
LIBS := -levent -lexplain | ||
|
Oops, something went wrong.