• Stars
    star
    315
  • Rank 132,951 (Top 3 %)
  • Language
    D
  • Created almost 12 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cross-platform DHCP test client

dhcptest

This is a DHCP test tool. It can send DHCP discover packets, and listen for DHCP replies.

The tool is cross-platform, although you will need to compile it yourself for non-Windows platforms.

The tool is written in the D Programming Language.

Download

You can download a compiled Windows executable from my website, here.

The latest development build for Windows can be downloaded from GitHub Actions.

Building

With DMD (or another D compiler) installed, run:

$ dmd dhcptest.d

Usage

By default, dhcptest starts in interactive mode. It will listen for DHCP replies, and allow sending DHCP discover packets using the "d" command. Type help in interactive mode for more information.

If you do not receive any replies, try using the --bind option (or --iface on Linux) to bind to a specific local interface.

The program can also run in automatic mode if the --query switch is specified on the command line.

An example command line to automatically send a discover packet and explicitly request option 43, wait for a reply, then print just that option:

dhcptest --quiet --query --request 43 --print-only 43

Options can also be specified by name:

dhcptest --quiet --query \
     --request    "Vendor Specific Information" \
     --print-only "Vendor Specific Information"

Query mode will report the first reply recieved. To automatically send a discover packet and wait for all replies before the timeout, use --wait. For additional resilience against dropped packets on busy networks, consider using the --retry and --timeout switches:

dhcptest --quiet --query --wait --retry 5 --timeout 10

You can spoof the Vendor Class Identifier, or send additional DHCP options with the request packet, using the --option switch:

dhcptest --query --option "60=Initech Groupware"

Option 82 (Relay Agent Information) can be specified as follows:

dhcptest --query --option "Relay Agent Information=agentCircuitID=\"foo\", agentRemoteID=\"bar\""

Run dhcptest --help for further details and additional command-line parameters.

For a list and description of DHCP options, see RFC 2132.

License

dhcptest is available under the Boost Software License 1.0.

Changelog

dhcptest v0.8 (2023-03-24)

  • Add --iface option for Linux
  • Add support for Linux raw sockets (--raw)
  • Add --bind, --target, and --target-port options
  • Add --giaddr option (contributed by pcsegal)
  • Improve formatting and parsing of many options

dhcptest v0.7 (2017-08-03)

  • Refactor and improve option value parsing

  • Allow specifying all supported format types in both --option and --print-only switches

  • Allow specifying DHCP option types by name as well as by number

  • Allow overriding the request type option. E.g., you can now send 'request' (instead of 'discover') packets using:

     --option "DHCP Message Type=request"
    
  • Add formatting support for options 42 (Network Time Protocol Servers Option) and 82 (Relay Agent Information)

  • Change how timeouts are handled:

    • Always default to some finite timeout (not just when --tries and --wait are absent), but still allow waiting indefinitely if 0 is specified.
    • Increase default timeout from 10 to 60 seconds.

dhcptest v0.6 (2017-08-02)

  • Add --secs switch
  • Contributed by Darren White:
    • Add --wait switch
    • The --print-only switch now understands output formatting: --print-only "N[hex]" will output the value as a zero padded hexadecimal string of bytes. --print-only "N[ip]" will output the value as an IP address.
  • Don't print stack trace on errors

dhcptest v0.5 (2014-11-26)

  • The --option switch now understands hexadecimal or IPv4-dotted-quad formatting:
    --option "N[hex]=XX XX XX ..." or --option "N[IP]=XXX.XXX.XXX.XXX"

dhcptest v0.4 (2014-07-21)

  • Add switches: --retry, --timeout, --option

dhcptest v0.3 (2014-04-05)

  • Add switches: --mac, --quiet, --query, --request, --print-only
  • Print program messages to standard error

dhcptest v0.2 (2014-03-25)

  • License under Boost Software License 1.0
  • Add documentation
  • Add --help switch
  • Add --bind switch to specify the interface to bind on
  • Print time values in human-readable form
  • Heuristically detect and print ASCII strings in unknown options
  • Add option names from RFC 2132
  • Add help and quit commands
  • Add MAC address option to discover command

dhcptest v0.1 (2013-01-10)

  • Initial release

More Repositories

1

aconfmgr

A configuration manager for Arch Linux
Shell
931
star
2

btdu

sampling disk usage profiler for btrfs
D
414
star
3

RABCDAsm

Robust ABC (ActionScript Bytecode) [Dis-]Assembler
D
411
star
4

DFeed

D news aggregator, newsgroup client, web newsreader and IRC bot
D
368
star
5

trimcheck

SSD TRIM check tool for Windows
D
236
star
6

ae

An auxiliary general-purpose D library
D
168
star
7

DustMite

General-purpose data reduction tool
D
112
star
8

hax11

Hackbrary to Hook and Augment X11 protocol calls
C
98
star
9

term-keys

Lossless keyboard input for Emacs
Emacs Lisp
90
star
10

Digger

A tool to build D and bisect old D versions
D
56
star
11

AutoMouseLock

Multi-monitor gaming helper
C++
34
star
12

WormKit

W:A Extension Framework
Pascal
30
star
13

wp2git

Downloads and imports Wikipedia page histories to a git repository
D
27
star
14

DuolingoMoreKeys

JavaScript
24
star
15

SlimD

Bare-bones D on Win32
D
20
star
16

swfutilsex

Some classes that use or extend the Adobe Flex 4 SDK that may be useful for reverse engineering.
Java
20
star
17

dmdprof

DMD compilation time profiler
Python
19
star
18

DBuildStat

Tools to measure and visualize performance of building D programs
D
17
star
19

tree-sitter-d

JavaScript
17
star
20

Ditto

Fork of Ditto Clipboard Manager
C++
14
star
21

TrenD

D stats/benchmarks and historic results
JavaScript
13
star
22

MMTool-Extract-All

D
12
star
23

csfo4

Fallout 4 native mods
D
11
star
24

MyWormNET2

WormNET server written in D
D
11
star
25

dscripten-tools

Alternative build toolchain for Dscripten
D
11
star
26

LiteUnits

Lightweight Delphi units to replace heavy system units like SysUtils. I did not write these, I only maintain them for personal projects.
Pascal
11
star
27

dlint

D
10
star
28

thincow

Create a deduplicated, COW view of block devices as a FUSE filesystem
D
9
star
29

DMapTreeMap

Visualizes D map files in a treemap
D
9
star
30

EnvMan

FAR plugin for comfortable management of environment variables
Pascal
9
star
31

steamkeyactivator

Cross-platform Steam bulk key activator
D
9
star
32

dcaptcha

CAPTCHA for D programming websites
D
8
star
33

keygen.js

<keygen> polyfill for modern browsers
JavaScript
8
star
34

Diamond

D memory debugger and profiler
D
8
star
35

DDD

Generic External-Memory Delayed-Duplicate-Detection Search Engine for Implicit Graphs. Based on Kwirk DDD solver ( http://github.com/CyberShadow/kwirk ).
C++
7
star
36

D-dot-git

Git repository generator for all D components
D
7
star
37

graphstudio

Fork of MONOGRAM GraphStudio
C++
7
star
38

misc

Miscellaneous (non-script) utilities to complement my dotfiles
D
7
star
39

FiddlerAutoCapture

Fiddler extension to automatically save all content hierarchically
C#
7
star
40

DAppenderResearch

Benchmarks and experiments in writing appenders in D
D
6
star
41

turbotuber

relentless external youtube-dl downloader for YouTube
D
6
star
42

cacheset64

64-bit CacheSet
C++
6
star
43

squelch

D
6
star
44

dbt-mode

Emacs Lisp
5
star
45

rtf2any

D
5
star
46

putty-terminfo

Attempt at a better terminfo for PuTTY
5
star
47

steamguides

Steam Guide Uploader
D
5
star
48

MyWormNET

Personal WormNET server software
PHP
5
star
49

data.d

D wrapper for raw data located in unmanaged memory.
D
5
star
50

SimpleIndent

C++
5
star
51

term-title

Emacs Lisp
5
star
52

ProcMonTools

Process Monitor stuff
D
5
star
53

ripfs

Simple deduplicating userspace filesystem for recordings of Internet radio stations.
D
5
star
54

ProSnooper

ProSnooper is an application that lets you connect to WormNET, chat on the channels, join and host games.
Pascal
5
star
55

KeyboardEmperor

Kernel-mode hack to speed up USB keyboards [I have no idea what I'm doing]
C
5
star
56

DBugTests

Curated D issue test case database
D
4
star
57

FAR

Obsolete, see https://github.com/CyberShadow/farmanager
C++
4
star
58

UniUpload

CyberShadow's file uploader
Pascal
4
star
59

TextNavigate

Obsolete. See:
C++
4
star
60

DDD-Kwirk

Kwirk module for generic DDD solver ( http://github.com/CyberShadow/DDD )
C++
4
star
61

xmacro

Fork of the xmacro program with some essential fixes
C
4
star
62

GHDaemon

Caching GitHub API proxy for Digger
D
4
star
63

ForumAntiSpam

Client-side forum spam filter
D
4
star
64

localcmdhistory

C++
4
star
65

colorout

Colorize your compiler’s output
D
3
star
66

cyberzshadow

My zsh theme
Shell
3
star
67

d-btrfs

D
3
star
68

win32

Shell
3
star
69

TimeTracker

Minimalistic time-tracking program for Windows
D
3
star
70

json2colorer

Utility to convert DMD .json output to Colorer wordlists
D
3
star
71

cirun

[WORK IN PROGRESS] Stand-alone CI test runner
D
3
star
72

ColorCalc

Command-line calculator for hex RGB colors.
D
3
star
73

image-quality

Quantifying generation loss using machine learning
Python
3
star
74

kwirk

Kwirk C++ solver. Obsolete, this project was split up into a generic DDD engine ( http://github.com/CyberShadow/DDD ) and the Kwirk module for it ( http://github.com/CyberShadow/DDD-Kwirk ).
C++
3
star
75

DDraw

Deprecated project, merged into ae:
D
2
star
76

monocre

D
2
star
77

DomainManager

D
2
star
78

pas2d

Simplistic text processor for doing part of grungework of Pascal->D conversion.
D
2
star
79

DvorakLayouts

Dvorak keyboard layouts
Shell
2
star
80

ShellUtils

Some stuff that goes into /usr/local/bin on my machines
Shell
2
star
81

Drain

D
2
star
82

metahumble

HumbleBundle Metalink generator
Python
2
star
83

multishellcheck

Lint multi-file scripts with ShellCheck
Shell
2
star
84

reduce

General-purpose data reduction tool
D
2
star
85

Team15

D1/Phobos library with various (mostly network) code
D
2
star
86

photosensitivity

Makefile
2
star
87

rwm

Remote Window Manager - list and manipulate windows remotely
D
2
star
88

SteamKeyAdder

Easily add bundle/retail keys to your Steam account
D
2
star
89

function_factory

D
2
star
90

ColorerVCLog

Combine Visual C++ build logs with colorer HTML output
D
2
star
91

DAutoTest

My D autotester (currently for just the documentation)
D
2
star
92

git-splice

Programs to splice histories of git repositories
D
2
star
93

ddoc2ghmd

Extremely simple filter to convert DMD Ddoc output to github Markdown
D
2
star
94

CpuUsageMon

D
2
star
95

AutoFix

D
2
star
96

PuttySessionsToSSH

Convert PuTTY sessions to OpenSSH config
D
2
star
97

SeatD

SeatD SVN mirror
D
2
star
98

dbot-server

D
1
star
99

dbot-client

D
1
star
100

dchmgen

D CHM generator
D
1
star