Click here to Skip to main content
6,595,444 members and growing! (17,319 online)
Email Password   helpLost your password?
General Programming » Internet / Network » General     Intermediate

Bare bones BOOTP daemon/server

By Dennis Kuppens

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.
VC8.0Win2K, WinXP, Visual Studio, MFC, Dev
Posted:17 Jul 2007
Views:8,030
Bookmarked:5 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
4 votes for this article.
Popularity: 1.81 Rating: 3.00 out of 5
2 votes, 50.0%
1

2

3

4
2 votes, 50.0%
5
Screenshot - bootpd.png

Introduction

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 '10.0.255.255'. In theory 255.255.255.255 means broadcast

    // to everyone in the world, but in practice filter routers these

    // messages.

    bootpd.m_broadcastIp    = "255.255.255.255";
    
    // Set the server address

    // Use 0.0.0.0 to listen to all network messages from anyone connected

    // to the network.

    bootpd.m_interfaceIp    = "0.0.0.0";
    
    // The ip address the bootp device should get.

    bootpd.m_targetIp        = "10.0.1.55";
    
    // 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. 

    bootpd.Start();
}    

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

History

1.0 | 9 June 2007 | Initial version.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Dennis Kuppens


Member

Occupation: Web Developer
Location: Netherlands Netherlands

Other popular Internet / Network articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 17 Jul 2007
Editor:
Copyright 2007 by Dennis Kuppens
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project