dhcpdiscover: add package
Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
parent
1da02dfe8c
commit
fa8347c042
4 changed files with 1425 additions and 0 deletions
39
utils/dhcpdiscover/Makefile
Normal file
39
utils/dhcpdiscover/Makefile
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#
|
||||||
|
# Copyright (C) 2006-2013 OpenWrt.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
# Author: p4u <pau@dabax.net>
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=dhcpdiscover
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/dhcpdiscover
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
|
define Package/dhcpdiscover
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=Network
|
||||||
|
TITLE:=dhcpdiscover
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/dhcpdiscover/description
|
||||||
|
Brings some information about the existing DHCP servers of the network
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/dhcpdiscover/install
|
||||||
|
$(INSTALL_DIR) $(1)/bin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dhcpdiscover $(1)/bin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,dhcpdiscover))
|
48
utils/dhcpdiscover/README.md
Normal file
48
utils/dhcpdiscover/README.md
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
* Program: dhcpdiscover
|
||||||
|
|
||||||
|
This program checks the existence and more details of a DHCP server
|
||||||
|
|
||||||
|
* About the code structure
|
||||||
|
|
||||||
|
The Makefile found in the directory of this README is for OpenWRT. It can be imported as a package. Inside the src/ directory the C code of dhcpdiscover can be found. If you want to compile it for your computer execute: cd src && make
|
||||||
|
|
||||||
|
* Licence information
|
||||||
|
|
||||||
|
Code under GPLv3
|
||||||
|
|
||||||
|
Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org), 2013 OpenWRT.org
|
||||||
|
|
||||||
|
* Contributors
|
||||||
|
|
||||||
|
Mike Gore 25 Aug 2005: Modified for standalone operation
|
||||||
|
Pau Escrich Jun 2013: Added -b option and ported to OpenWRT
|
||||||
|
|
||||||
|
|
||||||
|
___________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
Usage: dhcpdiscover [-s serverip] [-r requestedip] [-m clientmac ] [-b bannedip] [-t timeout] [-i interface]
|
||||||
|
[-v] -s, --serverip=IPADDRESS
|
||||||
|
IP address of DHCP server that we must hear from
|
||||||
|
-r, --requestedip=IPADDRESS
|
||||||
|
IP address that should be offered by at least one DHCP server
|
||||||
|
-m, --mac=MACADDRESS
|
||||||
|
Client MAC address to use for sending packets
|
||||||
|
-b, --bannedip=IPADDRESS
|
||||||
|
Server IP address to ignore
|
||||||
|
-t, --timeout=INTEGER
|
||||||
|
Seconds to wait for DHCPOFFER before timeout occurs
|
||||||
|
-i, --interface=STRING
|
||||||
|
Interface to to use for listening (i.e. eth0)
|
||||||
|
-v, --verbose
|
||||||
|
Print extra information (command-line use only)
|
||||||
|
-p, --prometheus
|
||||||
|
Print extra information in prometheus format
|
||||||
|
-h, --help
|
||||||
|
Print detailed help screen
|
||||||
|
-V, --version
|
||||||
|
Print version information
|
||||||
|
|
||||||
|
Example: sudo ./dhcpdiscover -i eth0 -b 192.168.1.1
|
||||||
|
```
|
13
utils/dhcpdiscover/src/Makefile
Normal file
13
utils/dhcpdiscover/src/Makefile
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
CC = gcc
|
||||||
|
CPPFLAGS =
|
||||||
|
CFLAGS = -Os -Wall
|
||||||
|
LDFLAGS =
|
||||||
|
CONFIGURE_ARGS =
|
||||||
|
|
||||||
|
all: dhcpdiscover
|
||||||
|
|
||||||
|
dhcpdiscover:
|
||||||
|
$(CC) -o dhcpdiscover dhcpdiscover.c
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f dhcpdiscover
|
1325
utils/dhcpdiscover/src/dhcpdiscover.c
Normal file
1325
utils/dhcpdiscover/src/dhcpdiscover.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue