Click here to Skip to main content
12,755,602 members (36,771 online)
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 16 Jul 2007

Bare Bones BOOTP Daemon/Server

, 17 Jul 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
This project presents a bare bones BOOTP daemon/server. Bootp is a protocol to assign an IP address to a device via its MAC address.
Screenshot - bootpd.png


This article describes a very bare bones bootp daemon/server.
I needed a very simple bootp daemon for my current project but I could not find one on CodeProject, so I programmed one.
For more information about the bootp protocol, see the Wikipedia site about it.

Using the Code

This bootp daemon only implements a subset of the bootp RFC-951 but it is enough to work for simple devices like the one I use in my project. The server can only handle one mac and IP address pair, but it is easy to expand the code to handle more pairs.

#include "bootpd.h"

void main(void)
    // Create the bootpd object
    Bootpd bootpd;

    // Set the broadcast address
    // You can use a mask to limit the broadcast scale
    // example ''. In theory means broadcast
    // to everyone in the world, but in practice filter routers these
    // messages.
    bootpd.m_broadcastIp    = "";
    // Set the server address
    // Use to listen to all network messages from anyone connected
    // to the network.
    bootpd.m_interfaceIp    = "";
    // The IP address the bootp device should get.
    bootpd.m_targetIp        = "";
    // The mac address of the device. Case insensitive.
    bootpd.m_targetMac        = "00:11:22:33:aa:bb";

    // Now start the server and listen to requests. 

Bootp is a connectionless protocol. This code will show you how to create a listening socket to listen to broadcast messages and how to send a broadcast message.


  • 1.0 | 9 June 2007 | Initial version


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Dennis Kuppens
Web Developer
Netherlands Netherlands
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 4 Pin
pietvredeveld28-Feb-12 23:33
memberpietvredeveld28-Feb-12 23:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 17 Jul 2007
Article Copyright 2007 by Dennis Kuppens
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid