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)
{
Bootpd bootpd;
bootpd.m_broadcastIp = "255.255.255.255";
bootpd.m_interfaceIp = "0.0.0.0";
bootpd.m_targetIp = "10.0.1.55";
bootpd.m_targetMac = "00:11:22:33:aa:bb";
bootpd.Start();
}
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.
History
- 1.0 | 9 June 2007 | Initial version