net-dhcp
v0.3.0
Published
DHCP
Downloads
7
Maintainers
Readme
DHCP
Dynamic Host Configuration Protocol (DHCP)
Install via npm
$ npm install --save net-dhcp
NOTE: This is still a work-in-progress; only message receipt and parsing is implemented at the time. The plan is to arrive at a fully functioning DHCP client & server implementation.
Examples
example/monitor
: Monitor the network for DHCP messages
Usage
var DHCP = require( 'net-dhcp' )
Client
var client = new DHCP.Client()
client.on( 'error', ( error ) => {
console.log( error )
})
client.on( 'message', ( message, rinfo ) => {
console.log( 'Message from', rinfo, message )
})
client.on( 'listening', ( socket ) => {
console.log( 'Listening on', socket.address() )
})
client.listen()
Server
var server = new DHCP.Server()
server.on( 'error', ( error ) => {
console.error( '[ERROR]', error )
})
// Warnings are emitted if a received packet could not be decoded
server.on( 'warning', ( error, rinfo, rawMessage ) => {
console.error( '[WARN]', rinfo, error )
})
server.on( 'message', ( message, rinfo ) => {
console.log( 'Client message from', rinfo, message )
})
server.on( 'listening', ( socket ) => {
console.log( 'Server listening on', socket.address() )
})
server.listen()
References
- RFC 951 / BOOTSTRAP PROTOCOL (BOOTP)
- RFC 1542 / Clarifications and Extensions for the Bootstrap Protocol
- RFC 2131 / Dynamic Host Configuration Protocol
- RFC 2132 / DHCP Options and BOOTP Vendor Extensions
- RFC 3046 / DHCP Relay Agent Information Option
- RFC 3396 / Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4)
- RFC 3397 / Dynamic Host Configuration Protocol (DHCP) Domain Search Option
- RFC 4436 / Detecting Network Attachment in IPv4 (DNAv4)
- RFC 6607 / Virtual Subnet Selection Options for DHCPv4 and DHCPv6
- RFC 6842 / Client Identifier Option in DHCP Server Replies
- RFC 8415 / Dynamic Host Configuration Protocol for IPv6 (DHCPv6)