├── Port-win32 ├── client.log ├── relay.log ├── server.log ├── .gitignore ├── bison++.exe ├── client-win32.ico ├── relay-win32.ico ├── server-win32.ico ├── dibbler-requestor.rc ├── unistd.h ├── relay-win32.vs2013.rc ├── parser.bat ├── resource.h ├── resource1.h ├── resource2.h ├── resource8.h ├── resource-requestor.h ├── client-win32.vs2013.rc ├── stdbool.h ├── ClntService.h ├── RelService.h ├── SrvService.h ├── Makefile.am └── server-win32.vs2013.rc ├── Requestor ├── Requestor.h ├── ReqOpts.cpp ├── ReqCfgMgr.cpp ├── TODO.txt ├── Makefile.am ├── ReqCfgMgr.h ├── ReqMsg.h ├── ReqTransMgr.h ├── ReqOpt.cpp ├── ReqOpt.h └── ReqMsg.cpp ├── bison++ ├── build-stamp ├── configure-stamp ├── Example │ ├── test.txt │ ├── test2.txt │ ├── Makefile │ ├── MyCompiler.cc │ └── MyScanner.l ├── bison++.yacc ├── bison.ps.gz ├── bison++.1.dman ├── stamp-vti ├── version.texi ├── version.cc ├── old.c ├── bison.cld ├── README++ ├── configure.ac ├── system.h ├── configure.bat └── types.h ├── doc ├── cppcheck-skip.txt ├── version.tex.in ├── logo-eti.png ├── logo-eu.jpg ├── logo-iip.png ├── logo-kti.png ├── logo-nss.png ├── logo-pg.png ├── class-diag.odp ├── dibbler-aaa.dia ├── dibbler-aaa.png ├── dibbler-relay.png ├── dibbler-user.pdf ├── dibbler-srv-cli.png ├── dibbler-worldmap.png ├── dibbler-multiple-cli.png ├── dibbler-multiple-srv.png ├── dibbler-prefixes-host.png ├── dibbler-cascade-relays.png ├── dibbler-devel-bibl.dox ├── dibbler-fqdn-cli-update.png ├── dibbler-fqdn-srv-update.png ├── dibbler-prefixes-router.png ├── dibbler-user-bibliography.tex ├── examples │ ├── relay-1interface.conf │ ├── client-ta.conf │ ├── server-ta.conf │ ├── server-script.conf │ ├── server-auth-replay.conf │ ├── server-auth.conf │ ├── relay-echo-remoteid.conf │ ├── client-auth-replay.conf │ ├── server-guess-mode.conf │ ├── server-win32.conf │ ├── client-auth.conf │ ├── client-win32.conf │ ├── server-bulk-lq.conf │ ├── server-subnet.conf │ ├── client-fqdn.conf │ ├── server-extraopts.conf │ ├── client-prefix-delegation.conf │ ├── server-client-classification.conf │ ├── client-stateless.conf │ ├── client-addrparams.conf │ ├── server-addrparams.conf │ ├── client-autodetect.conf │ ├── server-leasequery.conf │ ├── server-stateless.conf │ └── server-3classes.conf ├── TEST-METHOD ├── dibbler-devel-07-debug.dox └── dibbler-devel-01-intro.dox ├── tests ├── Makefile.am ├── testCase04 │ ├── client.conf │ └── server.conf ├── Srv │ ├── testdata │ │ └── info.txt │ └── run_tests.cpp ├── captures │ ├── dns.cap │ ├── dhcp-and-ddns.pcap │ └── info.txt ├── testCase05 │ ├── INFO │ ├── client.conf │ └── server.conf ├── testCase08 │ ├── server.conf │ └── INFO ├── testCase01 │ ├── server.conf │ └── INFO ├── testCase03 │ └── server.conf ├── remote-autoconf │ ├── capture1.pcap │ ├── capture2.pcap │ ├── capture3.pcap │ ├── capture4.pcap │ ├── remote-autoconf │ ├── server-3.conf │ ├── server-1.conf │ ├── client.conf │ └── server-2.conf ├── testCase06 │ ├── client.conf │ ├── INFO │ └── server.conf ├── testCase02 │ ├── client.conf │ └── INFO ├── testCase07 │ ├── INFO │ ├── server.conf │ └── client.conf ├── testCase09 │ └── INFO ├── 3.2-relay │ ├── server.conf │ ├── relay1.conf │ └── relay2.conf ├── utils │ ├── poslib_utils.h │ └── Makefile.am ├── Clnt │ └── run_tests.cc ├── tahi │ └── info.txt ├── DnsUpdate │ ├── DnsUpdate01.cpp │ └── Makefile ├── Logger │ └── basic01.cpp ├── LowLevel │ └── test1.cpp └── crypto │ └── Digests.cpp ├── poslib ├── AUTHORS ├── tests │ ├── run_tests.cc │ └── Makefile.am ├── NEWS ├── Makefile.am └── examples │ └── host.cpp ├── Port-linux ├── openwrt │ ├── INFO │ ├── dibbler │ │ ├── ipkg │ │ │ └── dibbler.control │ │ └── Config.in │ ├── ipkg │ │ ├── dibbler-relay.control │ │ ├── dibbler-client.control │ │ └── dibbler-server.control │ ├── patches │ │ └── dibbler-openwrt-poslib-host.patch │ └── Config.in ├── pld │ └── dibbler-0.3.1.spec ├── gentoo │ ├── net-misc │ │ └── dibbler │ │ │ ├── files │ │ │ ├── digest-dibbler-0.3.1 │ │ │ ├── digest-dibbler-0.4.1 │ │ │ ├── dibbler-relay │ │ │ ├── dibbler-client │ │ │ └── dibbler-server │ │ │ ├── metadata.xml │ │ │ ├── ChangeLog │ │ │ └── Manifest │ └── INFO ├── rtm_map.h ├── ll_map.h ├── Makefile.am ├── daemon.h └── rt_names.h ├── nettle ├── cbc.h ├── md5.c ├── md5.h ├── sha.h ├── hmac.c ├── hmac.h ├── base64.h ├── hmac-md5.c ├── macros.h ├── md5-meta.c ├── base64-decode.c ├── base64-encode.c ├── base64-meta.c ├── nettle-meta.h ├── nettle-internal.h ├── memxor.h ├── Makefile.am └── memxor.c ├── Options ├── OptFQDN.h ├── OptFQDN.cpp ├── tests │ ├── run_tests.cpp │ ├── OptDUID_unittest.cc │ └── OptOptionRequest_unittest.cc ├── OptAddrParams.h ├── OptVendorClass.h ├── OptEmpty.h ├── OptAddrParams.cpp ├── OptIA_NA.h ├── OptReconfigureMsg.h ├── OptEmpty.cpp ├── OptDUID.h ├── OptStatusCode.h ├── OptString.h ├── OptIA.h ├── OptTA.h ├── OptIA_PD.h ├── OptRtPrefix.h ├── OptAddrLst.h ├── OptInteger.h ├── OptDomainLst.h ├── OptGeneric.h ├── OptVendorClass.cpp ├── OptUserClass.h └── OptVendorData.h ├── IfaceMgr ├── DNSUpdate.cpp ├── DNSUpdate.h ├── SocketIPv6.h ├── tests │ ├── run_tests.cc │ └── Makefile.am └── Makefile.am ├── SrvCfgMgr ├── tests │ ├── testdata │ │ ├── info.txt │ │ └── keys-mapping │ └── run_tests.cpp ├── Node.cpp ├── NodeConstant.h ├── Node.h ├── SrvCfgClientClass.h └── NodeConstant.cpp ├── Messages └── Makefile.am ├── Port-bsd ├── malloc.h ├── Makefile.am └── daemon.h ├── scripts ├── remote-autoconf ├── hdr_mass ├── notify-scripts │ ├── client-notify-win32.cmd │ ├── server-notify-win32.cmd │ ├── client-notify-macos.sh │ └── server-notify.sh ├── Makefile ├── hdr ├── hdr_ins └── hdr_strip ├── ClntAddrMgr └── Makefile.am ├── RelCfgMgr └── RelLexer.h ├── RelTransMgr ├── tests │ └── run_tests.cpp └── Makefile.am ├── CfgMgr ├── tests │ ├── run_tests.cc │ ├── HostID_unittest.cc │ ├── HostRange_unittest.cc │ └── Makefile.am ├── Makefile.am └── HostID.h ├── Misc ├── tests │ ├── run_tests.cc │ └── Makefile.am ├── hmac-sha-md5.h ├── hex.h ├── DHCPRelay.h ├── long128.h ├── DHCPServer.h ├── KeyList.h ├── Key.h ├── ScriptParams.h ├── Makefile.am ├── DUID.h └── FQDN.h ├── AddrMgr ├── tests │ ├── run_tests.cpp │ ├── AddrAddr_unittest.cc │ ├── AddrPrefix_unittest.cc │ └── AddrIA_unittest.cc ├── Makefile.am ├── AddrPrefix.h └── AddrPrefix.cpp ├── Port-sun ├── Makefile.am └── daemon.h ├── RelOptions ├── Makefile.am ├── RelOptGeneric.cpp ├── RelOptEcho.cpp ├── RelOptGeneric.h ├── RelOptRemoteID.h ├── RelOptRemoteID.cpp ├── RelOptEcho.h ├── RelOptRelayMsg.h ├── RelOptInterfaceID.h ├── RelOptRelayMsg.cpp └── RelOptInterfaceID.cpp ├── RelMessages ├── Makefile.am ├── RelMsgGeneric.h ├── RelMsgRelayRepl.h ├── RelMsgRelayForw.h └── RelMsg.h ├── RelIfaceMgr └── Makefile.am ├── SrvAddrMgr └── Makefile.am ├── ClntTransMgr └── Makefile.am ├── SrvOptions ├── SrvOptFQDN.cpp ├── SrvOptIAPrefix.h ├── SrvOptAddrParams.h ├── SrvOptInterfaceID.h └── SrvOptFQDN.h ├── SrvTransMgr └── Makefile.am ├── SECURITY.md ├── ClntOptions ├── ClntOptElapsed.h ├── ClntOptLifetime.h ├── ClntOptPreference.cpp ├── ClntOptPreference.h ├── ClntOptTimeZone.h ├── ClntOptFQDN.h └── ClntOptElapsed.cpp ├── SrvIfaceMgr └── Makefile.am ├── SrvMessages ├── SrvMsgRebind.h ├── SrvMsgRenew.h ├── SrvMsgRelease.h ├── SrvMsgAdvertise.h ├── SrvMsgReconfigure.h ├── SrvMsgInfRequest.h ├── SrvMsgRelease.cpp ├── SrvMsgRenew.cpp ├── SrvMsgConfirm.cpp ├── SrvMsgRebind.cpp ├── SrvMsgInfRequest.cpp ├── SrvMsgLeaseQuery.h └── SrvMsgConfirm.h ├── ClntIfaceMgr └── Makefile.am ├── ClntMessages ├── ClntMsgReconfigure.h ├── ClntMsgDecline.h ├── ClntMsgReply.h ├── ClntMsgInfRequest.h ├── ClntMsgRenew.h ├── ClntMsgConfirm.h ├── ClntMsgRelease.h ├── Makefile.am ├── ClntMsgAdvertise.h ├── ClntMsgRebind.h └── ClntMsgRequest.h ├── ClntCfgMgr ├── ClntParsAddrOpt.h ├── ClntCfgTA.h ├── ClntParsAddrOpt.cpp ├── ClntCfgAddr.h └── ClntCfgTA.cpp ├── .github └── workflows │ └── gtest.yml └── m4 └── ltversion.m4 /Port-win32/client.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Port-win32/relay.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Port-win32/server.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Requestor/Requestor.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bison++/build-stamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bison++/configure-stamp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/cppcheck-skip.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Port-win32/.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | -------------------------------------------------------------------------------- /bison++/Example/test.txt: -------------------------------------------------------------------------------- 1 | 1+2+3+4 2 | -------------------------------------------------------------------------------- /Requestor/ReqOpts.cpp: -------------------------------------------------------------------------------- 1 | #include "ReqOpt.h" -------------------------------------------------------------------------------- /tests/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . utils Clnt Srv 2 | -------------------------------------------------------------------------------- /bison++/Example/test2.txt: -------------------------------------------------------------------------------- 1 | (TRUE OR FALSE) AND FALSE -------------------------------------------------------------------------------- /bison++/bison++.yacc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec bison -y "$@" -------------------------------------------------------------------------------- /doc/version.tex.in: -------------------------------------------------------------------------------- 1 | \newcommand{\version}{@PACKAGE_VERSION@} 2 | -------------------------------------------------------------------------------- /poslib/AUTHORS: -------------------------------------------------------------------------------- 1 | Meilof Veeningen -------------------------------------------------------------------------------- /tests/testCase04/client.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | 4 | 5 | } -------------------------------------------------------------------------------- /Port-linux/openwrt/INFO: -------------------------------------------------------------------------------- 1 | 2 | That is a preliminary build package for OpenWRT. -------------------------------------------------------------------------------- /nettle/cbc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/cbc.h -------------------------------------------------------------------------------- /nettle/md5.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/md5.c -------------------------------------------------------------------------------- /nettle/md5.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/md5.h -------------------------------------------------------------------------------- /nettle/sha.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/sha.h -------------------------------------------------------------------------------- /nettle/hmac.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/hmac.c -------------------------------------------------------------------------------- /nettle/hmac.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/hmac.h -------------------------------------------------------------------------------- /Options/OptFQDN.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Options/OptFQDN.h -------------------------------------------------------------------------------- /doc/logo-eti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/logo-eti.png -------------------------------------------------------------------------------- /doc/logo-eu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/logo-eu.jpg -------------------------------------------------------------------------------- /doc/logo-iip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/logo-iip.png -------------------------------------------------------------------------------- /doc/logo-kti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/logo-kti.png -------------------------------------------------------------------------------- /doc/logo-nss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/logo-nss.png -------------------------------------------------------------------------------- /doc/logo-pg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/logo-pg.png -------------------------------------------------------------------------------- /nettle/base64.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/base64.h -------------------------------------------------------------------------------- /nettle/hmac-md5.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/hmac-md5.c -------------------------------------------------------------------------------- /nettle/macros.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/macros.h -------------------------------------------------------------------------------- /nettle/md5-meta.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/md5-meta.c -------------------------------------------------------------------------------- /Options/OptFQDN.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Options/OptFQDN.cpp -------------------------------------------------------------------------------- /bison++/bison.ps.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/bison++/bison.ps.gz -------------------------------------------------------------------------------- /doc/class-diag.odp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/class-diag.odp -------------------------------------------------------------------------------- /doc/dibbler-aaa.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-aaa.dia -------------------------------------------------------------------------------- /doc/dibbler-aaa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-aaa.png -------------------------------------------------------------------------------- /tests/Srv/testdata/info.txt: -------------------------------------------------------------------------------- 1 | This is an empty directory. Test data will be stored here. 2 | 3 | -------------------------------------------------------------------------------- /IfaceMgr/DNSUpdate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/IfaceMgr/DNSUpdate.cpp -------------------------------------------------------------------------------- /IfaceMgr/DNSUpdate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/IfaceMgr/DNSUpdate.h -------------------------------------------------------------------------------- /IfaceMgr/SocketIPv6.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/IfaceMgr/SocketIPv6.h -------------------------------------------------------------------------------- /Port-win32/bison++.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Port-win32/bison++.exe -------------------------------------------------------------------------------- /SrvCfgMgr/tests/testdata/info.txt: -------------------------------------------------------------------------------- 1 | This is an empty directory. Test data will be stored here. 2 | 3 | -------------------------------------------------------------------------------- /bison++/bison++.1.dman: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/bison++/bison++.1.dman -------------------------------------------------------------------------------- /doc/dibbler-relay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-relay.png -------------------------------------------------------------------------------- /doc/dibbler-user.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-user.pdf -------------------------------------------------------------------------------- /nettle/base64-decode.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/base64-decode.c -------------------------------------------------------------------------------- /nettle/base64-encode.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/base64-encode.c -------------------------------------------------------------------------------- /nettle/base64-meta.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/base64-meta.c -------------------------------------------------------------------------------- /nettle/nettle-meta.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/nettle-meta.h -------------------------------------------------------------------------------- /tests/captures/dns.cap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/tests/captures/dns.cap -------------------------------------------------------------------------------- /tests/testCase05/INFO: -------------------------------------------------------------------------------- 1 | Server: 0.1.1-CVS, Linux 2 | Client: 0.1.1-CVS, Linux 3 | Bug : crashes 4 | -------------------------------------------------------------------------------- /doc/dibbler-srv-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-srv-cli.png -------------------------------------------------------------------------------- /doc/dibbler-worldmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-worldmap.png -------------------------------------------------------------------------------- /nettle/nettle-internal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/nettle/nettle-internal.h -------------------------------------------------------------------------------- /tests/testCase08/server.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | class 4 | { 5 | pool fe80::220:edff:fe2b:3b48 6 | } 7 | } -------------------------------------------------------------------------------- /Port-win32/client-win32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Port-win32/client-win32.ico -------------------------------------------------------------------------------- /Port-win32/relay-win32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Port-win32/relay-win32.ico -------------------------------------------------------------------------------- /Port-win32/server-win32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Port-win32/server-win32.ico -------------------------------------------------------------------------------- /tests/testCase01/server.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | class 4 | { 5 | pool 2000:2::1-2000:2::100 6 | } 7 | } -------------------------------------------------------------------------------- /doc/dibbler-multiple-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-multiple-cli.png -------------------------------------------------------------------------------- /doc/dibbler-multiple-srv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-multiple-srv.png -------------------------------------------------------------------------------- /doc/dibbler-prefixes-host.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-prefixes-host.png -------------------------------------------------------------------------------- /tests/testCase08/INFO: -------------------------------------------------------------------------------- 1 | Client : 0.1.1, WindowsXP 2 | Server : 0.1.1, Linux 3 | Report by: Thomson 4 | Details : -------------------------------------------------------------------------------- /doc/dibbler-cascade-relays.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-cascade-relays.png -------------------------------------------------------------------------------- /doc/dibbler-devel-bibl.dox: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @page bibliography 10. Bibliography 4 | 5 | 6 | @todo 7 | 8 | 9 | */ -------------------------------------------------------------------------------- /doc/dibbler-fqdn-cli-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-fqdn-cli-update.png -------------------------------------------------------------------------------- /doc/dibbler-fqdn-srv-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-fqdn-srv-update.png -------------------------------------------------------------------------------- /doc/dibbler-prefixes-router.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-prefixes-router.png -------------------------------------------------------------------------------- /Port-linux/pld/dibbler-0.3.1.spec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/Port-linux/pld/dibbler-0.3.1.spec -------------------------------------------------------------------------------- /bison++/stamp-vti: -------------------------------------------------------------------------------- 1 | @set UPDATED 11 May 2011 2 | @set UPDATED-MONTH May 2011 3 | @set EDITION 2.21.5 4 | @set VERSION 2.21.5 5 | -------------------------------------------------------------------------------- /doc/dibbler-user-bibliography.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/doc/dibbler-user-bibliography.tex -------------------------------------------------------------------------------- /tests/captures/dhcp-and-ddns.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/tests/captures/dhcp-and-ddns.pcap -------------------------------------------------------------------------------- /tests/testCase03/server.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | class 4 | { 5 | pool 2000:5::1-2000:5::100 6 | } 7 | } -------------------------------------------------------------------------------- /bison++/version.texi: -------------------------------------------------------------------------------- 1 | @set UPDATED 11 May 2011 2 | @set UPDATED-MONTH May 2011 3 | @set EDITION 2.21.5 4 | @set VERSION 2.21.5 5 | -------------------------------------------------------------------------------- /tests/remote-autoconf/capture1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/tests/remote-autoconf/capture1.pcap -------------------------------------------------------------------------------- /tests/remote-autoconf/capture2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/tests/remote-autoconf/capture2.pcap -------------------------------------------------------------------------------- /tests/remote-autoconf/capture3.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/tests/remote-autoconf/capture3.pcap -------------------------------------------------------------------------------- /tests/remote-autoconf/capture4.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszmrugalski/dibbler/HEAD/tests/remote-autoconf/capture4.pcap -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/files/digest-dibbler-0.3.1: -------------------------------------------------------------------------------- 1 | MD5 6bc2b0932f1000ad50624789873115d8 dibbler-0.3.1-src.tar.gz 2638077 2 | -------------------------------------------------------------------------------- /tests/testCase06/client.conf: -------------------------------------------------------------------------------- 1 | iface 4 2 | { 3 | dns-servers :: 4 | ia 3 5 | { 6 | address { } 7 | } 8 | } 9 | 10 | -------------------------------------------------------------------------------- /tests/testCase06/INFO: -------------------------------------------------------------------------------- 1 | Server : 0.1.1, WindowsXP 2 | Client : 0.1.1, WindowsXP 3 | Report by: Josep Sole, France Telecom R&D 4 | Details : -------------------------------------------------------------------------------- /tests/testCase02/client.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | IA 4 | { 5 | address 6 | { 7 | 20::1 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/testCase04/server.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | T1 10 4 | time-zone 'EST' 5 | class 6 | { 7 | pool 20::90-20::90 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /tests/testCase06/server.conf: -------------------------------------------------------------------------------- 1 | iface 4 2 | { 3 | class 4 | { 5 | pool 3ffe:1111::1-3ffe:1111::30 6 | RapidCommit 1 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Port-linux/openwrt/dibbler/ipkg/dibbler.control: -------------------------------------------------------------------------------- 1 | Package: dibbler 2 | Priority: optional 3 | Section: net 4 | Description: Dibbler - A portable DHCPv6 5 | 6 | 7 | -------------------------------------------------------------------------------- /bison++/version.cc: -------------------------------------------------------------------------------- 1 | char *version_string = "bison++ Version 1.21.9-1, adapted from GNU bison by coetmeur@icdc.fr\nMaintained by Magnus Ekdahl \n"; 2 | -------------------------------------------------------------------------------- /tests/captures/info.txt: -------------------------------------------------------------------------------- 1 | dhcp-and-ddns.pcap - downloaded from wireshark.org sample library 2 | DHCPv4 with DDNS using TSIG 3 | 4 | dns.cap -various DNS queries 5 | 6 | 7 | -------------------------------------------------------------------------------- /Messages/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libMessages.a 2 | 3 | libMessages_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/Options 4 | 5 | libMessages_a_SOURCES = Msg.cpp Msg.h 6 | -------------------------------------------------------------------------------- /Port-bsd/malloc.h: -------------------------------------------------------------------------------- 1 | 2 | /* dummy header for Mac OS X: malloc is defined in stdlib.h, not in malloc.h */ 3 | /* required for files generated by bison++ */ 4 | 5 | #include 6 | -------------------------------------------------------------------------------- /tests/testCase02/INFO: -------------------------------------------------------------------------------- 1 | Server : 2 | Client : 0.1.1, WindowsXP + SP1 3 | Report by: Thomson, during laboratories with students. 4 | Details : This config file does not work in Linux -------------------------------------------------------------------------------- /scripts/remote-autoconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "\033[32mRemote Autoconf script." 3 | echo "Received remote address $1 from srv $2 on $3/$4" 4 | echo "Remote autoconf script complete.\033[0m" 5 | -------------------------------------------------------------------------------- /scripts/hdr_mass: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | open(FILE, $ARGV[0]) or die "Unable to open '$ARGV[0]' file.\n"; 4 | 5 | while ($list = ) { 6 | `./hdr_ins $list`; 7 | } 8 | 9 | close(FILE); -------------------------------------------------------------------------------- /SrvCfgMgr/tests/testdata/keys-mapping: -------------------------------------------------------------------------------- 1 | # Comments starting with # are ignored. 2 | # So are empty lines 3 | 4 | 00:01:02:03:04:06:07:08:09, 0x010203ff 5 | 00:04:ff:ab:cd:ef:09:87:65:a1:bc, 0xabcdef00 6 | -------------------------------------------------------------------------------- /tests/testCase07/INFO: -------------------------------------------------------------------------------- 1 | Server : 0.1.1, WindowsXP 2 | Client : 0.1.1, WindowsXP 3 | Report by: Josep Sole, France Telecom R&D 4 | Details : Server is unable to read full (without ::) IPv6 address. 5 | -------------------------------------------------------------------------------- /Port-win32/dibbler-requestor.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource-requestor.h" 4 | 5 | IDI_ICON1 ICON "server-win32.ico" 6 | -------------------------------------------------------------------------------- /tests/remote-autoconf/remote-autoconf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "\033[32mRemote Autoconf script." 3 | echo "Received remote address $1 from srv $2 on $3/$4" 4 | echo "Remote autoconf script complete.\033[0m" 5 | -------------------------------------------------------------------------------- /tests/testCase07/server.conf: -------------------------------------------------------------------------------- 1 | iface eth0 2 | { 3 | option dns-server 2002:709:2efb:d34:548:1111:254:ff54 4 | class 5 | { 6 | pool 3ffe:1111::1-3ffe:1111::30 7 | 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /ClntAddrMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libClntAddrMgr.a 2 | 3 | libClntAddrMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/AddrMgr 4 | 5 | libClntAddrMgr_a_SOURCES = ClntAddrMgr.cpp ClntAddrMgr.h 6 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/files/digest-dibbler-0.4.1: -------------------------------------------------------------------------------- 1 | MD5 74545ef6e0f1166194de8c3b6e8d200a dibbler-0.4.1-src.tar.gz 1155154 2 | MD5 d7ee175bb1994b597e07583f4cc0113f dibbler-0.4.1-doc.tar.gz 1251723 3 | -------------------------------------------------------------------------------- /tests/testCase05/client.conf: -------------------------------------------------------------------------------- 1 | iface 'eth0' 2 | { 3 | option dns-server 4 | option domain 5 | option time-zone 6 | option ntp-server 7 | IA 8 | { 9 | address 10 | { 11 | 20::1 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Port-win32/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Mingw32 package. 3 | * 4 | * unistd.h maps (roughly) to io.h 5 | */ 6 | 7 | #ifndef __STRICT_ANSI__ 8 | #include 9 | #include 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /doc/examples/relay-1interface.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | log-level 8 4 | log-mode short 5 | 6 | iface "eth1" { 7 | server multicast no 8 | # server unicast 2001:db8:1::1 9 | client multicast yes 10 | interface-id 1234 11 | } 12 | -------------------------------------------------------------------------------- /tests/testCase09/INFO: -------------------------------------------------------------------------------- 1 | Client: 0.1.1, WindowsXP 2 | 3 | 4 | Details : 5 | - crashes if conf file does not start with "log-level 8" 6 | - crashes if interface name used instead of number 7 | - crashes if wrong interface named used 8 | -------------------------------------------------------------------------------- /tests/testCase05/server.conf: -------------------------------------------------------------------------------- 1 | iface eth0 2 | { 3 | option dns-server 20::1 4 | option domain ipv6.klub.com.pl 5 | option time-zone CET 6 | option ntp-server 20::2 7 | class 8 | { 9 | pool 2000:2::1-2000:2::100 10 | } 11 | } -------------------------------------------------------------------------------- /RelCfgMgr/RelLexer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | -------------------------------------------------------------------------------- /doc/examples/client-ta.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: Temporart addresses 3 | # 4 | 5 | log-level 8 6 | log-mode short 7 | 8 | iface eth0 9 | { 10 | ia // ask for normal address 11 | ta // ask for temporary address 12 | } 13 | -------------------------------------------------------------------------------- /doc/examples/server-ta.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | 4 | iface "eth0" { 5 | 6 | class { 7 | pool 2001:db8:1111::1-2001:db8:1111::ff 8 | } 9 | 10 | ta-class { 11 | pool 2001:db8:2222::1-2001:db8:2222::ffff 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tests/testCase07/client.conf: -------------------------------------------------------------------------------- 1 | log-mode short 2 | log-level 8 3 | 4 | iface 'eth0' 5 | { 6 | option dns-server 7 | option domain 8 | option time-zone 9 | option ntp-server 10 | IA 11 | { 12 | address 13 | { 14 | 20::1 15 | } 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Port-linux/openwrt/ipkg/dibbler-relay.control: -------------------------------------------------------------------------------- 1 | Package: dibbler-relay 2 | Priority: optional 3 | Section: net 4 | Description: Dibbler, a portable DHCPv6 implementation (relay) 5 | Maintainer: Michal Kowalczuk 6 | Source: http://klub.com.pl/dhcpv6/ 7 | -------------------------------------------------------------------------------- /scripts/notify-scripts/client-notify-win32.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Running Windows script client-notify-win32.cmd 3 | echo %1 address %ADDR1% on interface %IFACE%/%IFINDEX% 4 | echo Received domain %SRV_OPTION24% 5 | echo Received DNS servers %SRV_OPTION23% 6 | 7 | -------------------------------------------------------------------------------- /Port-linux/openwrt/ipkg/dibbler-client.control: -------------------------------------------------------------------------------- 1 | Package: dibbler-client 2 | Priority: optional 3 | Section: net 4 | Description: Dibbler, a portable DHCPv6 implementation (client) 5 | Maintainer: Michal Kowalczuk 6 | Source: http://klub.com.pl/dhcpv6/ 7 | -------------------------------------------------------------------------------- /Port-linux/openwrt/ipkg/dibbler-server.control: -------------------------------------------------------------------------------- 1 | Package: dibbler-server 2 | Priority: optional 3 | Section: net 4 | Description: Dibbler, a portable DHCPv6 implementation (server) 5 | Maintainer: Michal Kowalczuk 6 | Source: http://klub.com.pl/dhcpv6/ 7 | -------------------------------------------------------------------------------- /Requestor/ReqCfgMgr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * Released under GNU GPL v2 licence 7 | * 8 | * $Id: ReqCfgMgr.cpp,v 1.1 2007-12-02 10:31:59 thomson Exp $ 9 | */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /Requestor/TODO.txt: -------------------------------------------------------------------------------- 1 | Requestor TODO 2 | ---------------- 3 | - bind socket on loopback (server and requestor on the same machine) 4 | - make dst address configurable 5 | 6 | 7 | Requestor Questions 8 | --------------------- 9 | - which address send this data to? 10 | -------------------------------------------------------------------------------- /doc/examples/server-script.conf: -------------------------------------------------------------------------------- 1 | script "/home/thomson/devel/dibbler-git/server.sh" 2 | 3 | log-level 8 4 | 5 | iface eth0 { 6 | class { 7 | pool 2001::/64 8 | } 9 | 10 | pd-class { 11 | pd-pool 2001:db8:1::/56 12 | pd-length 64 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /tests/3.2-relay/server.conf: -------------------------------------------------------------------------------- 1 | log-level 7 2 | log-mode short 3 | 4 | iface relay1 5 | { 6 | relay eth0 7 | interface-id 6011 8 | rapid-commit 1 9 | T1 1000 10 | T2 2000 11 | 12 | // for all the others 13 | class { 14 | pool 6020::20-6020::ff 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Port-linux/rtm_map.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTM_MAP_H__ 2 | #define __RTM_MAP_H__ 1 3 | 4 | char *rtnl_rtntype_n2a(int id, char *buf, int len); 5 | int rtnl_rtntype_a2n(int *id, char *arg); 6 | 7 | int get_rt_realms(__u32 *realms, char *arg); 8 | 9 | 10 | #endif /* __RTM_MAP_H__ */ 11 | -------------------------------------------------------------------------------- /Options/tests/run_tests.cpp: -------------------------------------------------------------------------------- 1 | #define STDC_HEADERS 1 2 | 3 | #include 4 | #include 5 | 6 | int main(int argc, char* argv[]) { 7 | 8 | testing::InitGoogleTest(&argc, argv); 9 | int status = RUN_ALL_TESTS(); 10 | 11 | return status; 12 | } 13 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | no-herd 5 | thomson@klub.com.pl 6 | 7 | -------------------------------------------------------------------------------- /RelTransMgr/tests/run_tests.cpp: -------------------------------------------------------------------------------- 1 | #define STDC_HEADERS 1 2 | 3 | #include 4 | #include 5 | 6 | int main(int argc, char* argv[]) { 7 | 8 | testing::InitGoogleTest(&argc, argv); 9 | int status = RUN_ALL_TESTS(); 10 | 11 | return status; 12 | } 13 | -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.inc 2 | 3 | MAKEFLAGS= 4 | 5 | all: test14 6 | 7 | OBJECTS = test14.o 8 | 9 | test14: test14.cpp ../misc/Logger.cpp 10 | cd ../misc; $(MAKE) Logger.o 11 | $(CXX) $(OPTS) -o $@ $< ../misc/Logger.o 12 | 13 | objs: $(OBJECTS) 14 | 15 | libs: 16 | -------------------------------------------------------------------------------- /Options/tests/OptDUID_unittest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | using namespace std; 6 | 7 | TEST(OptDuidTest, constructors) { 8 | 9 | SPtr just_ptr; 10 | 11 | just_ptr.reset(new TOptDUID(OPTION_CLIENTID, SPtr(), NULL)); 12 | } 13 | -------------------------------------------------------------------------------- /scripts/notify-scripts/server-notify-win32.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem %1 denotes operation. Allowed operations: add, update, delete, expire 3 | 4 | rem Uncomment this to print out available variables 5 | rem set 6 | 7 | @echo %1 %ADDR1% for client %SRV_OPTION1% on interface %IFACE%/%IFINDEX% 8 | -------------------------------------------------------------------------------- /Port-bsd/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libLowLevel.a 2 | 3 | libLowLevel_a_CFLAGS = -std=c99 4 | libLowLevel_a_CPPFLAGS = -I$(top_srcdir)/Misc 5 | 6 | libLowLevel_a_SOURCES = daemon.cpp daemon.h lowlevel-bsd.c lowlevel-options-bsd.c malloc.h dibbler-client.cpp dibbler-server.cpp dibbler-relay.cpp 7 | -------------------------------------------------------------------------------- /CfgMgr/tests/run_tests.cc: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /Misc/tests/run_tests.cc: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /Port-win32/relay-win32.vs2013.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource8.h" 4 | 5 | // Icon with lowest ID value placed first to ensure application icon 6 | // remains consistent on all systems. 7 | IDI_ICON1 ICON "relay-win32.ico" 8 | -------------------------------------------------------------------------------- /poslib/tests/run_tests.cc: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /tests/Srv/run_tests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /AddrMgr/tests/run_tests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /IfaceMgr/tests/run_tests.cc: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /SrvCfgMgr/tests/run_tests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | int 10 | main(int argc, char* argv[]) { 11 | 12 | testing::InitGoogleTest(&argc, argv); 13 | int status = RUN_ALL_TESTS(); 14 | 15 | return status; 16 | } 17 | -------------------------------------------------------------------------------- /bison++/old.c: -------------------------------------------------------------------------------- 1 | /* JF changed to accept/deal with variable args. 2 | DO NOT change this to use varargs. It will appear to work 3 | but will break on systems that don't have the necessary library 4 | functions. This is the ONLY safe way to write such a function. */ 5 | /*VARARGS1*/ 6 | #include 7 | -------------------------------------------------------------------------------- /nettle/memxor.h: -------------------------------------------------------------------------------- 1 | /* memxor.h 2 | * 3 | */ 4 | 5 | #ifndef NETTLE_MEMXOR_H_INCLUDED 6 | #define NETTLE_MEMXOR_H_INCLUDED 7 | 8 | #include 9 | #include "nettle-types.h" 10 | 11 | uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n); 12 | 13 | #endif /* NETTLE_MEMXOR_H_INCLUDED */ 14 | -------------------------------------------------------------------------------- /tests/utils/poslib_utils.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef TEST_POSLIB_UTILS_H 4 | #define TEST_POSLIB_UTILS_H 5 | 6 | #include "poslib.h" 7 | 8 | namespace test { 9 | void hexToBin(const std::string& hex, message_buff &dst); 10 | bool cmpBuffers(const message_buff& a, const message_buff&b); 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /AddrMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS= . 2 | 3 | if HAVE_GTEST 4 | SUBDIRS += tests 5 | endif 6 | 7 | noinst_LIBRARIES = libAddrMgr.a 8 | 9 | libAddrMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc 10 | 11 | libAddrMgr_a_SOURCES = AddrAddr.cpp AddrAddr.h AddrClient.cpp AddrClient.h AddrIA.cpp AddrIA.h AddrMgr.cpp AddrMgr.h AddrPrefix.cpp AddrPrefix.h 12 | -------------------------------------------------------------------------------- /Options/tests/OptOptionRequest_unittest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | using namespace std; 6 | 7 | TEST(OptOROTest, constructors) { 8 | 9 | SPtr just_ptr; 10 | 11 | SPtr oro; 12 | oro.reset(new TOptOptionRequest(OPTION_ORO, NULL)); 13 | } 14 | -------------------------------------------------------------------------------- /Port-sun/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libLowLevel.a 2 | 3 | libLowLevel_a_CPPFLAGS = -I$(top_srcdir)/Misc 4 | 5 | libLowLevel_a_CFLAGS = -D__EXTENSIONS__ -D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 6 | 7 | libLowLevel_a_SOURCES = daemon.cpp daemon.h lowlevel-sun.c lowlevel-options-sun.c dibbler-client.cpp dibbler-server.cpp dibbler-relay.cpp 8 | -------------------------------------------------------------------------------- /tests/testCase01/INFO: -------------------------------------------------------------------------------- 1 | Server : 0.1.1, Linux 2 | Client : 0.1.1, Linux 3 | Report by: Thomson, during laboratories with students. 4 | Details : segfault in TAddrMgr::dbStore (this=0x80cfe70) at AddrMgr.cpp:81 5 | During trying to send ADVERTISE 6 | Status : Fix pending: SrvOptIA_NA.cpp: 182 classNr is sometimes negative 7 | 8 | -------------------------------------------------------------------------------- /CfgMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . 2 | 3 | if HAVE_GTEST 4 | SUBDIRS += tests 5 | endif 6 | 7 | noinst_LIBRARIES = libCfgMgr.a 8 | 9 | libCfgMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/IfaceMgr 10 | 11 | libCfgMgr_a_SOURCES = CfgMgr.cpp CfgMgr.h FlexLexer.h 12 | libCfgMgr_a_SOURCES += HostID.cpp HostID.h HostRange.cpp HostRange.h 13 | -------------------------------------------------------------------------------- /Port-win32/parser.bat: -------------------------------------------------------------------------------- 1 | @echo "Generating client files..." 2 | set FOO=..\ClntCfgMgr 3 | flex -+ -L -o%FOO%\ClntLexer.cpp %FOO%\ClntLexer.l 4 | bison++ --no-lines -d %FOO%\ClntParser.y -o %FOO%\ClntParser.cpp 5 | set FOO=..\SrvCfgMgr 6 | @echo "Generating server files..." 7 | flex -+ -L -o%FOO%\SrvLexer.cpp %FOO%\SrvLexer.l 8 | bison++ --no-lines -d %FOO%\SrvParser.y -o %FOO%\SrvParser.cpp 9 | -------------------------------------------------------------------------------- /scripts/hdr: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | if (1) { 4 | @list = `find .. -name \*.cpp -or -name \*.h`; 5 | } else { 6 | open(FILE, $ARGV[0]) or die "Unable to open $ARGV[0] file."; 7 | @list = ; 8 | close(FILE); 9 | }; 10 | 11 | foreach $file (@list) { 12 | if (`grep "GPL" $file`) { 13 | # print "GPL $file"; 14 | } else { 15 | print "$file"; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/Clnt/run_tests.cc: -------------------------------------------------------------------------------- 1 | 2 | #define STDC_HEADERS 1 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | std::string CLNTCONF_FILE(DEFAULT_CLNTCONF_FILE); 10 | 11 | int 12 | main(int argc, char* argv[]) { 13 | 14 | testing::InitGoogleTest(&argc, argv); 15 | int status = RUN_ALL_TESTS(); 16 | 17 | return status; 18 | } 19 | -------------------------------------------------------------------------------- /RelOptions/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libRelOptions.a 2 | 3 | libRelOptions_a_CPPFLAGS = -I$(top_srcdir)/Misc 4 | libRelOptions_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/RelOptions 5 | 6 | libRelOptions_a_SOURCES = RelOptEcho.cpp RelOptEcho.h RelOptGeneric.cpp RelOptGeneric.h RelOptInterfaceID.cpp RelOptInterfaceID.h RelOptRelayMsg.cpp RelOptRelayMsg.h RelOptRemoteID.cpp RelOptRemoteID.h 7 | -------------------------------------------------------------------------------- /doc/examples/server-auth-replay.conf: -------------------------------------------------------------------------------- 1 | # example server config file with authorization enabled 2 | # auth is not working yet, don't use it 3 | 4 | log-level 8 5 | log-mode short 6 | 7 | auth- 8 | auth-methods digest-hmac-md5 9 | auth-lifetime 1000 10 | 11 | iface "eth0" { 12 | 13 | t1 1000 14 | t2 2000 15 | 16 | 17 | class { 18 | pool 2001:db8::1/80 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Requestor/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libRequestor.a 2 | 3 | libRequestor_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/Messages 4 | libRequestor_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/IfaceMgr 5 | 6 | libRequestor_a_SOURCES = ReqCfgMgr.cpp ReqCfgMgr.h ReqMsg.cpp ReqMsg.h ReqOpt.cpp ReqOpt.h ReqOpts.cpp ReqTransMgr.cpp ReqTransMgr.h 7 | 8 | dist_noinst_DATA = TODO.txt 9 | 10 | -------------------------------------------------------------------------------- /doc/examples/server-auth.conf: -------------------------------------------------------------------------------- 1 | # example server config file with authorization enabled 2 | # auth is not working yet, don't use it 3 | 4 | log-level 8 5 | log-mode short 6 | 7 | auth-methods digest-hmac-md5 8 | auth-lifetime 1000 9 | auth-key-len 32 10 | 11 | iface "eth0" { 12 | 13 | t1 1000 14 | t2 2000 15 | 16 | 17 | class { 18 | pool 2001:db8::1/80 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /IfaceMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . 2 | 3 | if HAVE_GTEST 4 | SUBDIRS += tests 5 | endif 6 | 7 | noinst_LIBRARIES = libIfaceMgr.a 8 | 9 | libIfaceMgr_a_CPPFLAGS = -I$(top_srcdir)/poslib/poslib -I$(top_srcdir)/poslib -I$(top_srcdir)/Misc -I$(top_srcdir)/Messages -I$(top_srcdir)/Options 10 | 11 | libIfaceMgr_a_SOURCES = DNSUpdate.cpp DNSUpdate.h Iface.cpp Iface.h IfaceMgr.cpp IfaceMgr.h SocketIPv6.cpp SocketIPv6.h 12 | -------------------------------------------------------------------------------- /RelMessages/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libRelMessages.a 2 | 3 | libRelMessages_a_CPPFLAGS = -I$(top_srcdir)/Misc 4 | libRelMessages_a_CPPFLAGS += -I$(top_srcdir)/Messages 5 | libRelMessages_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/RelOptions 6 | 7 | libRelMessages_a_SOURCES = RelMsg.cpp RelMsgGeneric.cpp RelMsgGeneric.h RelMsg.h RelMsgRelayForw.cpp RelMsgRelayForw.h RelMsgRelayRepl.cpp RelMsgRelayRepl.h 8 | -------------------------------------------------------------------------------- /nettle/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libNettle.a 2 | 3 | libNettle_a_SOURCES = \ 4 | base64-decode.c \ 5 | base64-encode.c \ 6 | base64-meta.c \ 7 | base64.h \ 8 | cbc.h \ 9 | hmac-md5.c \ 10 | hmac.c \ 11 | hmac.h \ 12 | macros.h \ 13 | md5-meta.c \ 14 | md5.c \ 15 | md5.h \ 16 | memxor.c \ 17 | memxor.h \ 18 | nettle-internal.h \ 19 | nettle-meta.h \ 20 | nettle-types.h \ 21 | sha.h 22 | -------------------------------------------------------------------------------- /Port-linux/openwrt/dibbler/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_DIBBLER 2 | bool "busybox - The Swiss Army Knife of embedded Linux" 3 | default y 4 | help 5 | The Swiss Army Knife of embedded Linux. It slices, it dices, it 6 | makes Julian Fries. 7 | 8 | 9 | Most people will answer Y 10 | 11 | menu "Dibbler Configuration" 12 | depends BR2_PACKAGE_DIBBLER 13 | 14 | source package/busybox/config/Config.in 15 | 16 | endmenu 17 | -------------------------------------------------------------------------------- /tests/remote-autoconf/server-3.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | preference 0 4 | experimental 5 | 6 | iface "eth1" { 7 | 8 | unicast 2001:db8:3333::f 9 | rapid-commit 1 10 | class { 11 | pool 2001:db8:3333::/64 12 | } 13 | 14 | option dns-server 2001:db8:3333::f 15 | 16 | option neighbors 2001:db8:1111::f,2001:db8:2222::f 17 | 18 | # send those extra options to the client 19 | option 1234-0x012345679abcdef 20 | } 21 | -------------------------------------------------------------------------------- /doc/examples/relay-echo-remoteid.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | 4 | #option remote-id 5-0x01020304 5 | #option echo-request 100,101,102 6 | 7 | # Uncommenting this option will make relay to insert relay-id option 8 | # into forwarded RELAY-FORW messages. 9 | # option relay-id 00:01:02:03:04:05 10 | 11 | iface eth0 { 12 | client multicast yes 13 | interface-id 5555 14 | } 15 | 16 | iface eth1 { 17 | server multicast yes 18 | 19 | } -------------------------------------------------------------------------------- /RelIfaceMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libRelIfaceMgr.a 2 | 3 | libRelIfaceMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/IfaceMgr 4 | libRelIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/RelCfgMgr -I$(top_srcdir)/CfgMgr 5 | libRelIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/RelOptions 6 | libRelIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/RelMessages -I$(top_srcdir)/Messages 7 | 8 | libRelIfaceMgr_a_SOURCES = RelIfaceMgr.cpp RelIfaceMgr.h 9 | -------------------------------------------------------------------------------- /doc/examples/client-auth-replay.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: authentication 3 | # 4 | 5 | #log-mode short 6 | 7 | # 7 = omit debug messages 8 | log-level 8 9 | 10 | # authentication related parameters 11 | # authentication should be enabled 12 | auth-enabled true 13 | 14 | # client will accept following digests from the server 15 | auth-accept-methods digest-hmac-md5, digest-hmac-sha1 16 | 17 | iface eth0 { 18 | ia 19 | } 20 | -------------------------------------------------------------------------------- /CfgMgr/tests/HostID_unittest.cc: -------------------------------------------------------------------------------- 1 | #include "IPv6Addr.h" 2 | #include "DUID.h" 3 | #include "HostID.h" 4 | 5 | #include 6 | 7 | namespace { 8 | 9 | TEST(HostIDTest, constructor) { 10 | 11 | SPtr addr = new TIPv6Addr("fe80::abcd", true); 12 | SPtr duid = new TDUID("00:01:02:03:04"); 13 | 14 | SPtr host1 = new THostID(addr); 15 | 16 | /// @todo: implement tests for HostID class 17 | } 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Port-win32/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by client-win32.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /doc/examples/server-guess-mode.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | guess-mode 4 | 5 | iface "eth0" { 6 | // interface-id 5555 7 | 8 | class { 9 | pool 2001:db8::1/64 10 | } 11 | 12 | pd-class { 13 | pd-pool 2001:db8:1234::/60 14 | pd-length 64 15 | } 16 | 17 | # common configuration options, provided for all clients 18 | option dns-server 2001:db8::1 19 | option domain example.com 20 | option vendor-spec 5678-2-0xaaaa,1234-2-0x0102 21 | 22 | } 23 | -------------------------------------------------------------------------------- /doc/examples/server-win32.conf: -------------------------------------------------------------------------------- 1 | log-level 7 2 | 3 | log-mode short 4 | 5 | 6 | iface "Local Area Connection" 7 | { 8 | 9 | 10 | # clients should renew every half an hour 11 | 12 | T1 1800 13 | 14 | T2 2000 15 | 16 | class 17 | { 18 | 19 | pool 2001:db8:1111::1-2001:db8:1111::ff 20 | 21 | } 22 | 23 | 24 | option dns-server 2001:db8::1, 2001:db8::2 25 | 26 | option domain example.com, test1.example.com 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /CfgMgr/tests/HostRange_unittest.cc: -------------------------------------------------------------------------------- 1 | #include "IPv6Addr.h" 2 | #include "DUID.h" 3 | #include "HostRange.h" 4 | 5 | #include 6 | 7 | namespace { 8 | 9 | TEST(HostRangeTest, constructor) { 10 | SPtr addr1 = new TIPv6Addr("fe80::1", true); 11 | SPtr addr2 = new TIPv6Addr("fe80::ffff", true); 12 | 13 | SPtr range = new THostRange(addr1, addr2); 14 | 15 | /// @todo: implement tests for HostRange 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/ChangeLog: -------------------------------------------------------------------------------- 1 | # ChangeLog for net-misc/dibbler 2 | # Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2 3 | # $Header: /var/cvs/dibbler/Port-linux/gentoo/net-misc/dibbler/ChangeLog,v 1.2 2005-08-25 00:03:26 thomson Exp $ 4 | 5 | 25 Aug 2005; Tomasz Mrugalski dibbler-0.4.1.ebuild: 6 | Updated to the 0.4.1 version. 7 | 8 | 29 Dec 2004; Tomasz Mrugalski dibbler-0.3.1.ebuild: 9 | Initial ebuild version. 10 | -------------------------------------------------------------------------------- /poslib/NEWS: -------------------------------------------------------------------------------- 1 | ----------- 2 | Poslib NEWS 3 | ----------- 4 | 5 | When I (occasionally) update this file, it will contain some release highlights. 6 | 7 | Poslib 0.9.2 8 | * Full IPv6 support (was a bit incomplete and buggy before), both for servers 9 | and clients. 10 | * Support for a load more platforms 11 | * Yet some more bug fixes 12 | 13 | Poslib 0.9.1 14 | * Added async stop for client resolver 15 | * Added Borland C++ support 16 | * Various bug fixes 17 | 18 | Poslib 0.9.0 19 | * Initial release -------------------------------------------------------------------------------- /Port-win32/resource1.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by client-win32.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Port-win32/resource2.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by server-win32.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /Port-win32/resource8.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by relay-win32.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /RelOptions/RelOptGeneric.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 licence 7 | * 8 | * $Id: RelOptGeneric.cpp,v 1.3 2008-03-02 19:32:28 thomson Exp $ 9 | * 10 | */ 11 | 12 | #include "RelOptGeneric.h" 13 | 14 | TRelOptGeneric::TRelOptGeneric(int type, char* buf, int bufsize, TMsg* parent) 15 | :TOptGeneric(type, buf, bufsize, parent){ 16 | } 17 | 18 | bool TRelOptGeneric::doDuties() { 19 | return true; 20 | } 21 | -------------------------------------------------------------------------------- /SrvAddrMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libSrvAddrMgr.a 2 | 3 | libSrvAddrMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/AddrMgr 4 | libSrvAddrMgr_a_CPPFLAGS += -I$(top_srcdir)/SrvCfgMgr -I$(top_srcdir)/CfgMgr 5 | libSrvAddrMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/SrvOptions 6 | libSrvAddrMgr_a_CPPFLAGS += -I$(top_srcdir)/IfaceMgr -I$(top_srcdir)/SrvIfaceMgr 7 | libSrvAddrMgr_a_CPPFLAGS += -I$(top_srcdir)/SrvMessages -I$(top_srcdir)/Messages 8 | 9 | libSrvAddrMgr_a_SOURCES = SrvAddrMgr.cpp SrvAddrMgr.h 10 | -------------------------------------------------------------------------------- /Options/OptAddrParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #ifndef OPTADDRPARAMS_H 11 | #define OPTADDRPARAMS_H 12 | 13 | #include "OptInteger.h" 14 | 15 | class TOptAddrParams : public TOptInteger 16 | { 17 | public: 18 | TOptAddrParams(const char * buf, size_t len, TMsg* parent); 19 | 20 | int getPrefix(); 21 | int getBitfield(); 22 | bool doDuties(); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Port-linux/gentoo/INFO: -------------------------------------------------------------------------------- 1 | To install Dibbler in the Gentoo system, add following line to 2 | the /etc/make.conf file: 3 | 4 | PORTDIR_OVERLAY="/path/to/this/directory" 5 | 6 | Then issue following command: 7 | 8 | emerge dibbler 9 | 10 | Dibbler will be compiled in a Gentoo way. 11 | 12 | Interesting fact: This ebuild was uploaded to the bugs.gentoo.org 13 | (see bug #76084, http://bugs.gentoo.org/show_bug.cgi?id=76084). 14 | There's a distinct possibility that it will be incorporated to the 15 | main Gentoo portage in a near future. 16 | -------------------------------------------------------------------------------- /Port-linux/ll_map.h: -------------------------------------------------------------------------------- 1 | #ifndef __LL_MAP_H__ 2 | #define __LL_MAP_H__ 1 3 | 4 | extern int ll_remember_index(const struct sockaddr_nl *who, 5 | struct nlmsghdr *n, void *arg); 6 | extern int ll_init_map(struct rtnl_handle *rth); 7 | extern unsigned ll_name_to_index(const char *name); 8 | extern const char *ll_index_to_name(unsigned idx); 9 | extern const char *ll_idx_n2a(unsigned idx, char *buf); 10 | extern int ll_index_to_type(unsigned idx); 11 | extern unsigned ll_index_to_flags(unsigned idx); 12 | 13 | #endif /* __LL_MAP_H__ */ 14 | -------------------------------------------------------------------------------- /Port-win32/resource-requestor.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by dibbler-requestor.rc 4 | // 5 | #define IDI_ICON1 102 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 103 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /doc/examples/client-auth.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: authentication 3 | # 4 | 5 | #log-mode short 6 | 7 | # 7 = omit debug messages 8 | log-level 8 9 | 10 | # authentication should be enabled 11 | # There are 4 allowed values here: none (this is the default), delayed, reconfigure-key, dibbler 12 | auth-protocol dibbler 13 | 14 | 15 | # client will accept following digests from the server (used in dibbler protocol) 16 | auth-accept-methods digest-hmac-md5, digest-hmac-sha1 17 | 18 | iface eth0 { 19 | ia 20 | } 21 | -------------------------------------------------------------------------------- /tests/remote-autoconf/server-1.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | log-colors 0 4 | preference 2 5 | 6 | experimental 7 | 8 | iface "eth0" { 9 | 10 | t1 1800 11 | class { 12 | pool 2001:db8:1111::/64 13 | } 14 | 15 | rapid-commit 1 16 | unicast 2001:db8:1111::f 17 | 18 | option dns-server 2001:db8:1111::f 19 | option domain alfa.example.com 20 | option time-zone CET 21 | option nis-server 2001:db8:1111::abc 22 | option nis-domain alfa.example.com 23 | 24 | option neighbors 2001:db8:2222::f,2001:db8:3333::f 25 | } 26 | -------------------------------------------------------------------------------- /nettle/memxor.c: -------------------------------------------------------------------------------- 1 | /* memxor.c 2 | * 3 | * $Id: memxor.c,v 1.1.2.1 2005/01/28 22:50:03 meilof Exp $ 4 | */ 5 | 6 | /* XOR LEN bytes starting at SRCADDR onto DESTADDR. Result undefined 7 | if the source overlaps with the destination. 8 | Return DESTADDR. */ 9 | 10 | #if HAVE_CONFIG_H 11 | # include "dibbler-config.h" 12 | #endif 13 | 14 | #include "memxor.h" 15 | 16 | uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n) 17 | { 18 | size_t i; 19 | for (i = 0; i 5 | * changes: Tomasz Mrugalski 6 | * 7 | * Released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | void *hmac_sha (const char *buffer, size_t len, char *key, size_t key_len, char *resbuf, int type); 16 | void *hmac_md5 (const char *buffer, size_t len, char *key, size_t key_len, char *resbuf); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /Requestor/ReqCfgMgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * Released under GNU GPL v2 licence 7 | * 8 | * $Id: ReqCfgMgr.h,v 1.3 2007-12-08 04:14:03 thomson Exp $ 9 | */ 10 | 11 | #ifndef REQCFGMGR_H 12 | #define REQCFGMGR_H 13 | 14 | typedef struct { 15 | // global parameters 16 | char * iface; 17 | int timeout; 18 | 19 | char * dstaddr; 20 | 21 | // message specific parameters 22 | char * addr; 23 | char * duid; 24 | } ReqCfgMgr; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /tests/remote-autoconf/client.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: default 3 | # 4 | 5 | # Uncomment following line to make confirm enable at start 6 | #skip-confirm 7 | 8 | log-mode short 9 | log-colors 1 10 | 11 | # 7 = omit debug messages 12 | log-level 8 13 | 14 | experimental 15 | remote-autoconf 16 | 17 | iface "eth0" { 18 | ia 19 | unicast 1 20 | option dns-server 21 | option domain 22 | option nis-server 23 | option nis-domain 24 | option nis+-server 25 | option nis+-domain 26 | option time-zone 27 | option lifetime 28 | } 29 | -------------------------------------------------------------------------------- /AddrMgr/tests/AddrAddr_unittest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | namespace test { 7 | 8 | class AddrAddrTest : public ::testing::Test { 9 | public: 10 | AddrAddrTest() { } 11 | }; 12 | 13 | TEST_F(AddrAddrTest, constructor) { 14 | SPtr addr = new TIPv6Addr("fe80::abcd", true); 15 | 16 | SPtr addrAddr = new TAddrAddr(addr, 100, 200); 17 | 18 | EXPECT_EQ(100u, addrAddr->getPref() ); 19 | EXPECT_EQ(200u, addrAddr->getValid() ); 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /RelMessages/RelMsgGeneric.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef RELMSGGENERIC_H 12 | #define RELMSGGENERIC_H 13 | 14 | #include "RelMsg.h" 15 | 16 | class TRelMsgGeneric: public TRelMsg { 17 | 18 | public: 19 | TRelMsgGeneric(int iface, SPtr addr, char * data, int dataLen); 20 | std::string getName() const; 21 | bool check(); 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /RelOptions/RelOptEcho.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #include "SmartPtr.h" 11 | #include "RelOptEcho.h" 12 | 13 | TRelOptEcho::TRelOptEcho( char * buf, int n, TMsg* parent) 14 | :TOptOptionRequest(OPTION_ERO, buf, n, parent) 15 | { 16 | } 17 | 18 | TRelOptEcho::TRelOptEcho(TMsg* parent) 19 | :TOptOptionRequest(OPTION_ERO, parent) 20 | { 21 | } 22 | 23 | bool TRelOptEcho::doDuties() 24 | { 25 | return true; 26 | } 27 | -------------------------------------------------------------------------------- /ClntTransMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libClntTransMgr.a 2 | 3 | libClntTransMgr_a_CPPFLAGS = -I$(top_srcdir)/ClntCfgMgr -I$(top_srcdir)/CfgMgr -I$(top_srcdir)/Misc 4 | libClntTransMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/ClntOptions 5 | libClntTransMgr_a_CPPFLAGS += -I$(top_srcdir)/AddrMgr -I$(top_srcdir)/ClntAddrMgr 6 | libClntTransMgr_a_CPPFLAGS += -I$(top_srcdir)/ClntMessages -I$(top_srcdir)/Messages 7 | libClntTransMgr_a_CPPFLAGS += -I$(top_srcdir)/ClntIfaceMgr -I$(top_srcdir)/IfaceMgr 8 | 9 | 10 | libClntTransMgr_a_SOURCES = ClntTransMgr.cpp ClntTransMgr.h 11 | -------------------------------------------------------------------------------- /scripts/notify-scripts/client-notify-macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ServiceID=`echo show State:/Network/Global/IPv6 | /usr/sbin/scutil | awk '/PrimaryService/ { print $3 }'` 4 | 5 | echo $ServiceID 6 | 7 | echo "open" > /tmp/resolv.conf-dhcp 8 | echo "d.init" >> /tmp/resolv.conf-dhcp 9 | echo "d.add ServerAddresses * $SRV_OPTION23" >> /tmp/resolv.conf-dhcp 10 | echo "d.add DomainName $SRV_OPTION24" >> /tmp/resolv.conf-dhcp 11 | echo "set State:/Network/Service/$ServiceID/DNS" >> /tmp/resolv.conf-dhcp 12 | echo "quit" >> /tmp/resolv.conf-dhcp 13 | 14 | /usr/sbin/scutil < /tmp/resolv.conf-dhcp 15 | -------------------------------------------------------------------------------- /AddrMgr/tests/AddrPrefix_unittest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | namespace test { 9 | 10 | TEST(AddrPrefixTest, constructor) { 11 | SPtr addr = new TIPv6Addr("fe80::abcd", true); 12 | 13 | SPtr prefix = new TAddrPrefix(addr, 100, 200, 64); 14 | 15 | EXPECT_EQ(100u, prefix->getPref() ); 16 | EXPECT_EQ(200u, prefix->getValid() ); 17 | EXPECT_EQ(64, prefix->getLength() ); 18 | EXPECT_EQ(string("fe80::abcd"), prefix->get()->getPlain()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Port-linux/openwrt/patches/dibbler-openwrt-poslib-host.patch: -------------------------------------------------------------------------------- 1 | diff -ur dibbler-0.5.0.orig/Makefile dibbler-0.5.0/Makefile 2 | --- dibbler-0.5.0.orig/Makefile 2006-10-06 00:58:22.000000000 +0200 3 | +++ dibbler-0.5.0/Makefile 2007-01-30 16:15:08.000000000 +0100 4 | @@ -144,7 +144,7 @@ 5 | 6 | poslib-configure: 7 | @echo "[CONFIG ] /poslib/" 8 | - cd $(PREFIX)/poslib; test -e "config.h" || ./configure >configure-poslib.log; 9 | + cd $(PREFIX)/poslib; test -e "config.h" || ./configure $(POSLIB_HOST) >configure-poslib.log; 10 | 11 | relaylibs: includes 12 | @for dir in $(RELSUBDIRS); do \ 13 | -------------------------------------------------------------------------------- /RelTransMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . 2 | 3 | if HAVE_GTEST 4 | SUBDIRS += tests 5 | endif 6 | 7 | noinst_LIBRARIES = libRelTransMgr.a 8 | 9 | libRelTransMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc 10 | libRelTransMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/RelOptions 11 | libRelTransMgr_a_CPPFLAGS += -I$(top_srcdir)/RelCfgMgr -I$(top_srcdir)/CfgMgr 12 | libRelTransMgr_a_CPPFLAGS += -I$(top_srcdir)/Messages -I$(top_srcdir)/RelMessages 13 | libRelTransMgr_a_CPPFLAGS += -I$(top_srcdir)/IfaceMgr -I$(top_srcdir)/RelIfaceMgr 14 | 15 | libRelTransMgr_a_SOURCES = RelTransMgr.cpp RelTransMgr.h 16 | -------------------------------------------------------------------------------- /tests/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/CfgMgr 2 | AM_CPPFLAGS += -I$(top_srcdir)/Misc 3 | AM_CPPFLAGS += -I$(top_srcdir)/poslib 4 | 5 | # This is to workaround long long in gtest.h 6 | AM_CPPFLAGS += $(GTEST_INCLUDES) -Wno-long-long -Wno-variadic-macros 7 | 8 | noinst_LIBRARIES = libTestUtils.a libgtest.a 9 | 10 | libTestUtils_a_SOURCES = poslib_utils.cc poslib_utils.h 11 | 12 | libgtest_a_CXXFLAGS = $(GTEST_INCLUDES) $(AM_CXXFLAGS) 13 | nodist_libgtest_a_SOURCES = gtest-all.cc 14 | 15 | gtest-all.cc: $(GTEST_SOURCE)/src/gtest-all.cc 16 | cp -p $(GTEST_SOURCE)/src/gtest-all.cc $@ 17 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/files/dibbler-relay: -------------------------------------------------------------------------------- 1 | #!/sbin/runscript 2 | # Copyright 1999-2004 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | # $Header: /var/cvs/dibbler/Port-linux/gentoo/net-misc/dibbler/files/dibbler-relay,v 1.1 2005-08-25 00:03:26 thomson Exp $ 5 | 6 | depend() { 7 | need net 8 | } 9 | 10 | start() { 11 | ebegin "Starting DHCPv6 relay: dibbler-relay" 12 | /usr/sbin/dibbler-relay start 13 | eend $? 14 | } 15 | 16 | stop() { 17 | ebegin "Stopping DHCPv6 relay: dibbler-relay" 18 | /usr/sbin/dibbler-relay stop 19 | eend $? 20 | } 21 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/files/dibbler-client: -------------------------------------------------------------------------------- 1 | #!/sbin/runscript 2 | # Copyright 1999-2004 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | # $Header: /var/cvs/dibbler/Port-linux/gentoo/net-misc/dibbler/files/dibbler-client,v 1.1 2005-08-25 00:03:26 thomson Exp $ 5 | 6 | depend() { 7 | need net 8 | } 9 | 10 | start() { 11 | ebegin "Starting DHCPv6 client: dibbler-client" 12 | /usr/sbin/dibbler-client start 13 | eend $? 14 | } 15 | 16 | stop() { 17 | ebegin "Stopping DHCPv6 client: dibbler-client" 18 | /usr/sbin/dibbler-client stop 19 | eend $? 20 | } 21 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/files/dibbler-server: -------------------------------------------------------------------------------- 1 | #!/sbin/runscript 2 | # Copyright 1999-2004 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public License v2 4 | # $Header: /var/cvs/dibbler/Port-linux/gentoo/net-misc/dibbler/files/dibbler-server,v 1.1 2005-08-25 00:03:26 thomson Exp $ 5 | 6 | depend() { 7 | need net 8 | } 9 | 10 | start() { 11 | ebegin "Starting DHCPv6 server: dibbler-server" 12 | /usr/sbin/dibbler-server start 13 | eend $? 14 | } 15 | 16 | stop() { 17 | ebegin "Stopping DHCPv6 server: dibbler-server" 18 | /usr/sbin/dibbler-server stop 19 | eend $? 20 | } 21 | -------------------------------------------------------------------------------- /RelOptions/RelOptGeneric.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 licence 7 | * 8 | * $Id: RelOptGeneric.h,v 1.4 2008-03-02 19:32:28 thomson Exp $ 9 | * 10 | */ 11 | 12 | #ifndef RELOPTGENERIC_H 13 | #define RELOPTGENERIC_H 14 | 15 | #include "DHCPConst.h" 16 | #include "OptGeneric.h" 17 | 18 | class TRelOptGeneric : public TOptGeneric 19 | { 20 | public: 21 | TRelOptGeneric(int type, char* buf, int bufsize, TMsg* parent); 22 | bool doDuties(); 23 | 24 | }; 25 | 26 | #endif /* RELOPTGENERIC_H */ 27 | -------------------------------------------------------------------------------- /SrvOptions/SrvOptFQDN.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #include "SrvOptFQDN.h" 12 | 13 | TSrvOptFQDN::TSrvOptFQDN(const std::string& fqdn, TMsg* parent) 14 | :TOptFQDN(fqdn, parent) { 15 | this->setNFlag(false); 16 | } 17 | 18 | TSrvOptFQDN::TSrvOptFQDN(char *buf, int bufsize, TMsg* parent) 19 | :TOptFQDN(buf, bufsize, parent) { 20 | 21 | } 22 | 23 | bool TSrvOptFQDN::doDuties() { 24 | return true; 25 | } 26 | -------------------------------------------------------------------------------- /SrvCfgMgr/Node.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author : Vinh Nghiem Nguyen 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 or later licence 8 | * 9 | * $Id: Node.cpp,v 1.1 2008-10-12 19:36:58 thomson Exp $ 10 | * 11 | */ 12 | 13 | /* 14 | * Node.cpp 15 | * 16 | * Created on: 9 sept. 2008 17 | */ 18 | #ifndef NODE_CPP_ 19 | #define NODE_CPP_ 20 | 21 | #include "Node.h" 22 | #include "SrvMsg.h" 23 | 24 | Node::Node(NodeType type) 25 | { 26 | Type = type; 27 | } 28 | 29 | Node::~Node() 30 | { 31 | } 32 | 33 | #endif /* NODE_H_ */ 34 | 35 | -------------------------------------------------------------------------------- /SrvTransMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libSrvTransMgr.a 2 | 3 | libSrvTransMgr_a_CPPFLAGS = -I$(top_srcdir)/SrvCfgMgr -I$(top_srcdir)/CfgMgr -I$(top_srcdir)/Misc 4 | libSrvTransMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/SrvOptions 5 | libSrvTransMgr_a_CPPFLAGS += -I$(top_srcdir)/AddrMgr -I$(top_srcdir)/SrvAddrMgr 6 | libSrvTransMgr_a_CPPFLAGS += -I$(top_srcdir)/SrvMessages -I$(top_srcdir)/Messages 7 | libSrvTransMgr_a_CPPFLAGS += -I$(top_srcdir)/SrvIfaceMgr -I$(top_srcdir)/IfaceMgr 8 | libSrvTransMgr_a_CPPFLAGS += -I$(top_srcdir)/poslib 9 | 10 | libSrvTransMgr_a_SOURCES = SrvTransMgr.cpp SrvTransMgr.h 11 | -------------------------------------------------------------------------------- /doc/examples/client-win32.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: Windows 3 | # 4 | 5 | # This config file is commented out. 6 | # Dibbler-client will autodetect all up, running, IPv6-supporting, physical interfaces and will try 7 | # to obtain one IPv6 address on each of them. 8 | 9 | # To manually specify, what parameter should be obtained, uncomment appropriate sections below. 10 | # To get full list of supported options, see Dibbler User's Guide. 11 | 12 | log-mode short 13 | 14 | # 7 = omit debug messages 15 | log-level 7 16 | 17 | iface "Local Area Connection" { 18 | ia 19 | option dns-server 20 | } 21 | -------------------------------------------------------------------------------- /Options/OptVendorClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | */ 8 | 9 | #ifndef OPTVENDORCLASS_H 10 | #define OPTVENDORCLASS_H 11 | 12 | #include "OptUserClass.h" 13 | #include 14 | 15 | class TOptVendorClass : public TOptUserClass 16 | { 17 | public: 18 | uint32_t Enterprise_id_; 19 | 20 | TOptVendorClass(uint16_t type, const char* buf, unsigned short buf_len, TMsg* parent); 21 | size_t getSize(); 22 | char * storeSelf( char* buf); 23 | }; 24 | 25 | #endif /* USERCLASS_H */ 26 | -------------------------------------------------------------------------------- /SrvOptions/SrvOptIAPrefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author T Krzysztof Wnuk 5 | * 6 | * 7 | */ 8 | 9 | #ifndef SRVOPTIAPREFIX_H 10 | #define SRVOPTIAPREFIX_H 11 | 12 | #include "SmartPtr.h" 13 | #include "Container.h" 14 | #include "OptIAPrefix.h" 15 | 16 | class TSrvOptIAPrefix : public TOptIAPrefix { 17 | public: 18 | TSrvOptIAPrefix( char * addr, int n, TMsg* parent); 19 | 20 | TSrvOptIAPrefix(SPtr prefix,char length, unsigned long pref, 21 | unsigned long valid, TMsg* parent); 22 | 23 | bool doDuties(); 24 | 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /RelOptions/RelOptRemoteID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | class TRelOptRemoteID; 11 | #ifndef RELOPTREMOTEID_H 12 | #define RELOPTREMOTEID_H 13 | 14 | #include "OptVendorData.h" 15 | 16 | class TRelOptRemoteID : public TOptVendorData 17 | { 18 | public: 19 | TRelOptRemoteID(int enterprise, char * data, int dataLen, TMsg* parent); 20 | TRelOptRemoteID(char * buf, int n, TMsg* parent); 21 | bool doDuties(); 22 | private: 23 | }; 24 | 25 | #endif /* CLNTOPTVENDORSPECINFO_H */ 26 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | None. 6 | 7 | This project is no longer maintained. It used to be a hobby project of one person 8 | for 15 years, but even that basic substitute of a support is now gone. 9 | 10 | ## Reporting a Vulnerability 11 | 12 | If you discover a vunlerability, your best course of action is to migrate to other 13 | implementations, such as https://github.com/isc-projects/kea, which are maintained. 14 | 15 | You may also open an issue. There is nobody to address a problem, but it might 16 | be useful to inform other users that the software they still use is 17 | vulnerable. 18 | -------------------------------------------------------------------------------- /doc/examples/server-bulk-lq.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file 3 | # 4 | # This config. file is for planned bulk leasequery functionality 5 | # that is not available yet. Do not use it unless you are a dibbler 6 | # developer 7 | # 8 | 9 | # Logging level range: 1(Emergency)-8(Debug) 10 | log-level 8 11 | 12 | # Don't log full date 13 | log-mode short 14 | 15 | # Uncomment this to enable bulk-leasequery 16 | bulk-leasequery-timeout 301 17 | bulk-leasequery-max-conns 11 18 | bulk-leasequery-accept 1 19 | bulk-leasequery-tcp-port 548 20 | 21 | iface "eth0" { 22 | 23 | class { 24 | pool 2001:db8::/64 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ClntOptions/ClntOptElapsed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef CLNTOPTELAPSED_H 11 | #define CLNTOPTELAPSED_H 12 | 13 | #include "OptInteger.h" 14 | 15 | class TClntOptElapsed : public TOptInteger 16 | { 17 | public: 18 | TClntOptElapsed(TMsg* parent); 19 | TClntOptElapsed( char * buf, int n, TMsg* parent); 20 | 21 | char * storeSelf(char* buf); 22 | bool doDuties(); 23 | private: 24 | unsigned long Timestamp; 25 | }; 26 | #endif 27 | -------------------------------------------------------------------------------- /doc/examples/server-subnet.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file: Relays 3 | # 4 | # Server must be configured to support relayed traffic. This is 5 | # an example how to do this. 6 | 7 | log-level 8 8 | log-mode short 9 | 10 | iface relay1 { 11 | relay eth0 12 | interface-id 5020 13 | T1 1000 14 | T2 2000 15 | 16 | subnet 2001:db8:2222::/64 17 | 18 | // this pool will be used for clients connected via relay 19 | class { 20 | pool 2001:db8:2222::1-2001:db8:2222::ff 21 | } 22 | 23 | option dns-server 2001:db8::100, 2001:db8::101 24 | option domain example.com, test1.example.com 25 | } 26 | -------------------------------------------------------------------------------- /Misc/hex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * Released under GNU GPL v2 licence 7 | * 8 | */ 9 | 10 | #ifndef HEX_H 11 | #define HEX_H 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | std::vector textToHex(std::string buf); 18 | 19 | std::string hexToText(const uint8_t* buf, size_t buf_len, bool add_colons = false, 20 | bool add_0x = false); 21 | 22 | std::string hexToText(const std::vector& vector, bool add_colons = false, 23 | bool add_0x = false); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Options/OptEmpty.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef OPTRAPIDCOMMIT_H 11 | #define OPTRAPIDCOMMIT_H 12 | 13 | #include "DHCPConst.h" 14 | #include "Opt.h" 15 | 16 | class TOptEmpty : public TOpt 17 | { 18 | public: 19 | TOptEmpty(int code, TMsg* parent); 20 | TOptEmpty(int code, const char * buf, int n, TMsg* parent); 21 | size_t getSize(); 22 | char * storeSelf(char* buf); 23 | bool doDuties() { return false; } 24 | }; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Port-win32/client-win32.vs2013.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource1.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | //#include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | // Icon with lowest ID value placed first to ensure application icon 16 | // remains consistent on all systems. 17 | IDI_ICON1 ICON "client-win32.ico" 18 | -------------------------------------------------------------------------------- /SrvIfaceMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libSrvIfaceMgr.a 2 | 3 | libSrvIfaceMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/IfaceMgr 4 | libSrvIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/SrvCfgMgr -I$(top_srcdir)/CfgMgr 5 | libSrvIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/SrvOptions 6 | libSrvIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/AddrMgr -I$(top_srcdir)/SrvAddrMgr -I$(top_srcdir)/SrvTransMgr 7 | libSrvIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/SrvMessages -I$(top_srcdir)/Messages 8 | libSrvIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/poslib/poslib -I$(top_srcdir)/poslib 9 | 10 | libSrvIfaceMgr_a_SOURCES = SrvIfaceMgr.cpp SrvIfaceMgr.h 11 | -------------------------------------------------------------------------------- /scripts/hdr_ins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | $name = $ARGV[0]; 4 | 5 | print "FILE: $name\n"; 6 | 7 | open(FILE, $name) or die "Unable to open $name file."; 8 | @tmptable = ; 9 | $data = join "", @tmptable; 10 | close(FILE); 11 | 12 | $hdr='/* 13 | * Dibbler - a portable DHCPv6 14 | * 15 | * authors: Tomasz Mrugalski 16 | * Marek Senderski 17 | * 18 | * released under GNU GPL v2 or later licence 19 | */ 20 | '; 21 | 22 | unlink("$name") or die "Unable to delete $name file."; 23 | 24 | open(RESULT, ">$name") or die "Unable to create $name file\n"; 25 | print RESULT "$hdr\n$data"; 26 | close(RESULT); 27 | 28 | -------------------------------------------------------------------------------- /Misc/DHCPRelay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | #ifndef DHCPSERVER_H 12 | #define DHCPSERVER_H 13 | 14 | #include 15 | #include 16 | 17 | class TDHCPRelay 18 | { 19 | public: 20 | TDHCPRelay(const std::string& config); 21 | void run(); 22 | void stop(); 23 | bool isDone(); 24 | bool checkPrivileges(); 25 | void setWorkdir(std::string workdir); 26 | ~TDHCPRelay(); 27 | 28 | private: 29 | bool IsDone; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /doc/examples/client-fqdn.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: DNS Update (FQDN) 3 | # 4 | 5 | log-level 8 6 | 7 | # uncomment following line to force S bit to 0 8 | # option fqdn-s 0 9 | 10 | # Set protocol to one of the following values: udp, tcp, any 11 | ddns-protocol udp 12 | 13 | # Sets DDNS Update timeout (in ms) 14 | ddns-timeout 800 15 | 16 | iface eth0 { 17 | # ask for an address 18 | ia 19 | 20 | # ask for DNS server's address 21 | option dns-server 22 | 23 | # ask for fully qualified domain name (any name will do) 24 | # option fqdn 25 | # you can also provide hint for the server 26 | option fqdn dexter.example.org 27 | } 28 | -------------------------------------------------------------------------------- /Misc/long128.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * $Id: long128.h,v 1.3 2004-03-29 22:06:49 thomson Exp $ 8 | * 9 | * $Log: not supported by cvs2svn $ 10 | * 11 | * Released under GNU GPL v2 licence 12 | * 13 | */ 14 | 15 | #ifndef LONG128_H 16 | #define LONG128_H 17 | #include "IPv6Addr.h" 18 | #include "SmartPtr.h" 19 | 20 | class ulong128 21 | { 22 | public: 23 | ulong128(); 24 | ulong128(SPtr addr); 25 | ulong128 operator+(ulong128& other); 26 | 27 | private: 28 | unsigned char bytes[16]; 29 | }; 30 | #endif 31 | -------------------------------------------------------------------------------- /RelOptions/RelOptRemoteID.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #include "RelOptRemoteID.h" 11 | #include "DHCPConst.h" 12 | 13 | TRelOptRemoteID::TRelOptRemoteID( char * buf, int n, TMsg* parent) 14 | :TOptVendorData(OPTION_REMOTE_ID, buf,n, parent) 15 | { 16 | } 17 | 18 | TRelOptRemoteID::TRelOptRemoteID(int enterprise, char * data, int dataLen, TMsg* parent) 19 | :TOptVendorData(OPTION_REMOTE_ID, enterprise, data, dataLen, parent) 20 | { 21 | } 22 | 23 | bool TRelOptRemoteID::doDuties() { 24 | return true; 25 | } 26 | -------------------------------------------------------------------------------- /Options/OptAddrParams.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #include "OptAddrParams.h" 11 | #include "DHCPConst.h" 12 | 13 | TOptAddrParams::TOptAddrParams(const char * buf, size_t len, TMsg* parent) 14 | :TOptInteger(OPTION_ADDRPARAMS, 2, buf, len, parent) 15 | { 16 | 17 | } 18 | 19 | int TOptAddrParams::getPrefix() 20 | { 21 | return (Value >> 8) & 0xff; 22 | } 23 | 24 | int TOptAddrParams::getBitfield() 25 | { 26 | return Value & 0xff; 27 | } 28 | 29 | bool TOptAddrParams::doDuties() 30 | { 31 | return true; 32 | } 33 | -------------------------------------------------------------------------------- /RelOptions/RelOptEcho.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | * $Id: RelOptEcho.h,v 1.2 2008-08-29 00:07:32 thomson Exp $ 9 | * 10 | */ 11 | 12 | #ifndef RELOPTECHO_H 13 | #define RELOPTECHO_H 14 | 15 | #include "DHCPConst.h" 16 | #include "SmartPtr.h" 17 | #include "OptOptionRequest.h" 18 | 19 | class TRelOptEcho; 20 | 21 | class TRelOptEcho : public TOptOptionRequest 22 | { 23 | public: 24 | TRelOptEcho(char * buf, int n, TMsg* parent); 25 | TRelOptEcho(TMsg* parent); 26 | bool doDuties(); 27 | }; 28 | 29 | #endif /* RelOptEcho */ 30 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgRebind.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef SRVMSGREBIND_H 12 | #define SRVMSGREBIND_H 13 | #include "SrvMsg.h" 14 | 15 | class TSrvMsgRebind : public TSrvMsg 16 | { 17 | public: 18 | TSrvMsgRebind(int iface, SPtr addr, char* buf, int bufSize); 19 | 20 | void doDuties(); 21 | std::string getName() const; 22 | unsigned long getTimeout(); 23 | bool check(); 24 | ~TSrvMsgRebind(); 25 | }; 26 | 27 | #endif /* SRVMSGREBIND_H */ 28 | -------------------------------------------------------------------------------- /Requestor/ReqMsg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #ifndef REQMSG_H 11 | #define REQMSG_H 12 | 13 | #include 14 | #include "Msg.h" 15 | #include "SmartPtr.h" 16 | 17 | class TReqMsg: public TMsg 18 | { 19 | public: 20 | TReqMsg(int iface, SPtr addr, int msgType); 21 | // used to create TMsg object based on received char[] data 22 | TReqMsg(int iface, SPtr addr, char* &buf, int &bufSize); 23 | void addOption(SPtr opt); 24 | 25 | std::string getName() const; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /RelOptions/RelOptRelayMsg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | * $Id: RelOptRelayMsg.h,v 1.1 2005-01-11 22:53:36 thomson Exp $ 10 | * 11 | * $Log: not supported by cvs2svn $ 12 | */ 13 | 14 | #ifndef RELOPTRELAYMSG_H 15 | #define RELOPTRELAYMSG_H 16 | 17 | #include "DHCPConst.h" 18 | #include "OptGeneric.h" 19 | 20 | class TRelOptRelayMsg : public TOptGeneric 21 | { 22 | public: 23 | TRelOptRelayMsg(char* buf, int bufsize, TMsg* parent); 24 | bool doDuties(); 25 | }; 26 | 27 | #endif /* RELOPTGENERIC_H */ 28 | -------------------------------------------------------------------------------- /SrvCfgMgr/NodeConstant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Nguyen Vinh Nghiem 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 or later licence 8 | * 9 | */ 10 | 11 | #ifndef NODECONSTANT_H_ 12 | #define NODECONSTANT_H_ 13 | #include "Node.h" 14 | #include 15 | 16 | class NodeConstant : public Node 17 | { 18 | public : 19 | NodeConstant(); 20 | NodeConstant(std::string v); 21 | ~NodeConstant(); 22 | std::string getStringValue(); 23 | std::string value; 24 | virtual std::string exec(); 25 | virtual std::string exec(SPtr msg); 26 | }; 27 | #endif /* NODECONSTANT_H_ */ 28 | -------------------------------------------------------------------------------- /tests/DnsUpdate/DnsUpdate01.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DNSUpdate.h" 3 | 4 | #include "base64.h" 5 | 6 | int main() 7 | { 8 | char *plain = "any carnal pleasure."; 9 | char encoded[128]; 10 | char decoded[128]; 11 | 12 | base64_encode(plain, strlen(plain), encoded, 128); 13 | 14 | printf("encoded [%s] => [%s]\n", plain, encoded); 15 | 16 | // decode 17 | struct base64_decode_context ctx; 18 | base64_decode_ctx_init(&ctx); 19 | 20 | size_t decodedLen; 21 | base64_decode(&ctx, encoded, strlen(encoded), 22 | decoded, &decodedLen); 23 | 24 | printf("decoded [%s] => [%s]\n", encoded, decoded); 25 | 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /tests/remote-autoconf/server-2.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | preference 1 4 | 5 | experimental 6 | 7 | iface "eth1" { 8 | 9 | t1 1800-2000 10 | t2 2700-3000 11 | prefered-lifetime 3600 12 | valid-lifetime 7200 13 | unicast 2001:db8:2222::f 14 | rapid-commit 1 15 | 16 | class { 17 | pool 2001:db8:2222::/64 18 | } 19 | 20 | option dns-server 2000::ff,2000::fe 21 | option domain bravo.example.com 22 | option ntp-server 2000::200,2000::201,2000::202 23 | option time-zone CET 24 | option sip-server 2000::300,2000::302,2000::303,2000::304 25 | option sip-domain sip1.example.com,sip2.example.com 26 | 27 | option neighbors 2001:db8:1111::f,2001:db8:3333::f 28 | } 29 | -------------------------------------------------------------------------------- /ClntOptions/ClntOptLifetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntOptLifetime.h,v 1.3 2008-08-29 00:07:29 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef CLNTOPTLIFETIME_H 14 | #define CLNTOPTLIFETIME_H 15 | 16 | #include "DHCPConst.h" 17 | #include "OptInteger.h" 18 | 19 | class TClntOptLifetime : public TOptInteger 20 | { 21 | public: 22 | TClntOptLifetime(char * buf, int n, TMsg* parent); 23 | 24 | TClntOptLifetime(char pref, TMsg* parent); 25 | bool doDuties(); 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /Port-linux/openwrt/Config.in: -------------------------------------------------------------------------------- 1 | config BR2_PACKAGE_DIBBLER 2 | tristate 3 | depends BR2_PACKAGE_DIBBLER_SERVER || BR2_PACKAGE_DIBBLER_CLIENT || BR2_PACKAGE_DIBBLER_RELAY 4 | default n 5 | 6 | config BR2_PACKAGE_DIBBLER_SERVER 7 | prompt "dibbler-server" 8 | tristate "dibbler server" 9 | default m if CONFIG_DEVEL 10 | select BR2_PACKAGE_DIBBLER 11 | 12 | config BR2_PACKAGE_DIBBLER_CLIENT 13 | prompt "dibbler-client" 14 | tristate "dibbler client" 15 | default m if CONFIG_DEVEL 16 | select BR2_PACKAGE_DIBBLER 17 | 18 | config BR2_PACKAGE_DIBBLER_RELAY 19 | prompt "dibbler-relay" 20 | tristate "dibbler relay" 21 | default m if CONFIG_DEVEL 22 | select BR2_PACKAGE_DIBBLER 23 | -------------------------------------------------------------------------------- /ClntOptions/ClntOptPreference.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #include "DHCPConst.h" 12 | #include "ClntOptPreference.h" 13 | 14 | TClntOptPreference::TClntOptPreference( char * buf, int n, TMsg* parent) 15 | :TOptInteger(OPTION_PREFERENCE, 1, buf,n, parent) 16 | { 17 | 18 | } 19 | 20 | TClntOptPreference::TClntOptPreference( char pref, TMsg* parent) 21 | :TOptInteger(OPTION_PREFERENCE, 1, pref, parent) 22 | { 23 | } 24 | 25 | bool TClntOptPreference::doDuties() 26 | { 27 | return true; 28 | } 29 | -------------------------------------------------------------------------------- /Misc/DHCPServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef DHCPSERVER_H 11 | #define DHCPSERVER_H 12 | 13 | #include 14 | #include 15 | #include "SmartPtr.h" 16 | 17 | class TDHCPServer 18 | { 19 | public: 20 | TDHCPServer(const std::string& config); 21 | void run(); 22 | void stop(); 23 | bool isDone(); 24 | bool checkPrivileges(); 25 | void setWorkdir(std::string workdir); 26 | ~TDHCPServer(); 27 | 28 | private: 29 | bool IsDone_; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /SrvOptions/SrvOptAddrParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | * $Id: SrvOptAddrParams.h,v 1.3 2008-08-29 00:07:35 thomson Exp $ 9 | * 10 | */ 11 | 12 | #ifndef SRVOPTADDRPARAMS_H 13 | #define SRVOPTADDRPARAMS_H 14 | #include "OptInteger.h" 15 | 16 | class TSrvOptAddrParams : public TOptInteger 17 | { 18 | public: 19 | TSrvOptAddrParams(int prefix, int bitfield, TMsg * parent); 20 | TSrvOptAddrParams(char * buf, int n, TMsg* parent); 21 | 22 | int getPrefix(); 23 | int getBitfield(); 24 | bool doDuties(); 25 | }; 26 | 27 | 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ClntIfaceMgr/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libClntIfaceMgr.a 2 | 3 | libClntIfaceMgr_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/IfaceMgr 4 | libClntIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/ClntCfgMgr -I$(top_srcdir)/CfgMgr 5 | libClntIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/Options -I$(top_srcdir)/ClntOptions 6 | libClntIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/AddrMgr -I$(top_srcdir)/ClntAddrMgr -I$(top_srcdir)/ClntTransMgr 7 | libClntIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/ClntMessages -I$(top_srcdir)/Messages 8 | libClntIfaceMgr_a_CPPFLAGS += -I$(top_srcdir)/poslib/poslib -I$(top_srcdir)/poslib 9 | 10 | libClntIfaceMgr_a_SOURCES = ClntIfaceIface.cpp ClntIfaceIface.h ClntIfaceMgr.cpp ClntIfaceMgr.h 11 | -------------------------------------------------------------------------------- /SrvOptions/SrvOptInterfaceID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef SRVOPTIONINTERFACEID_H 12 | #define SRVOPTIONINTERFACEID_H 13 | #include "OptGeneric.h" 14 | 15 | class TSrvOptInterfaceID : public TOptGeneric 16 | { 17 | 18 | public: 19 | bool operator==(const TSrvOptInterfaceID &other) const; 20 | TSrvOptInterfaceID(int id, TMsg * parent); 21 | TSrvOptInterfaceID(const char * buf, int n, TMsg* parent); 22 | bool doDuties(); 23 | }; 24 | 25 | 26 | 27 | #endif /* OPTIONINTERFACEID_H */ 28 | -------------------------------------------------------------------------------- /CfgMgr/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/Misc 2 | AM_CPPFLAGS += -I$(top_srcdir)/CfgMgr 3 | 4 | # This is to workaround long long in gtest.h 5 | AM_CPPFLAGS += $(GTEST_INCLUDES) -Wno-long-long -Wno-variadic-macros 6 | 7 | TESTS = 8 | if HAVE_GTEST 9 | TESTS += CfgMgr_tests 10 | 11 | CfgMgr_tests_SOURCES = run_tests.cc 12 | CfgMgr_tests_SOURCES += HostID_unittest.cc 13 | CfgMgr_tests_SOURCES += HostRange_unittest.cc 14 | 15 | CfgMgr_tests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) 16 | 17 | CfgMgr_tests_LDADD = $(GTEST_LDADD) 18 | CfgMgr_tests_LDADD += $(top_builddir)/CfgMgr/libCfgMgr.a 19 | CfgMgr_tests_LDADD += $(top_builddir)/Misc/libMisc.a 20 | endif 21 | 22 | noinst_PROGRAMS = $(TESTS) 23 | -------------------------------------------------------------------------------- /SrvCfgMgr/Node.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Nguyen Vinh Nghiem 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 or later licence 8 | * 9 | */ 10 | 11 | #ifndef NODE_H_ 12 | #define NODE_H_ 13 | #include 14 | #include "SmartPtr.h" 15 | 16 | class TSrvMsg; 17 | class Node 18 | { 19 | public: 20 | enum NodeType 21 | { 22 | NODE_OPERATOR = 1, 23 | NODE_CONST = 2, 24 | NODE_CLIENT_SPECIFIC = 3 25 | }; 26 | 27 | Node(NodeType type); 28 | virtual ~Node(); 29 | virtual std::string exec(SPtr msg) = 0; 30 | 31 | NodeType Type; 32 | }; 33 | 34 | #endif /* NODE_H_ */ 35 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgReconfigure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Grzegorz Pluto 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 or later licence 8 | * 9 | */ 10 | 11 | #ifndef CLNTMSGRECONFIGURE_H 12 | #define CLNTMSGRECONFIGURE_H 13 | 14 | #include "ClntMsg.h" 15 | 16 | class TClntMsgReconfigure : public TClntMsg 17 | { 18 | public: 19 | TClntMsgReconfigure(int iface, SPtr addr, 20 | char* buf, int bufSize); 21 | 22 | bool check(); 23 | void doDuties(); 24 | std::string getName() const { return std::string("RECONFIGURE"); } 25 | ~TClntMsgReconfigure(); 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /RelOptions/RelOptInterfaceID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: RelOptInterfaceID.h,v 1.4 2008-08-29 00:07:32 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef RELOPTIONINTERFACEID_H 14 | #define RELOPTIONINTERFACEID_H 15 | #include "OptInteger.h" 16 | 17 | class TRelOptInterfaceID : public TOptInteger 18 | { 19 | public: 20 | TRelOptInterfaceID(char * data, int dataLen, TMsg* parent); 21 | TRelOptInterfaceID(int interfaceID, TMsg* parent); 22 | bool doDuties(); 23 | }; 24 | 25 | #endif /* RELOPTIONINTERFACEID_H */ 26 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgRenew.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * chamges Krzysztof Wnuk 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef SRVMSGRENEW_H 12 | #define SRVMSGRENEW_H 13 | #include "SrvMsg.h" 14 | 15 | class TSrvMsgRenew : public TSrvMsg 16 | { 17 | public: 18 | TSrvMsgRenew(int iface, SPtr addr, char* buf, int bufSize); 19 | 20 | void doDuties(); 21 | unsigned long getTimeout(); 22 | std::string getName() const; 23 | bool check(); 24 | ~TSrvMsgRenew(); 25 | }; 26 | 27 | #endif /* SRVMSGRENEW_H */ 28 | -------------------------------------------------------------------------------- /Misc/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/Misc 2 | AM_CPPFLAGS += -I$(top_srcdir)/CfgMgr 3 | 4 | # This is to workaround long long in gtest.h 5 | AM_CPPFLAGS += $(GTEST_INCLUDES) -Wno-long-long -Wno-variadic-macros 6 | 7 | TESTS = 8 | if HAVE_GTEST 9 | TESTS += Misc_tests 10 | 11 | Misc_tests_SOURCES = run_tests.cc 12 | Misc_tests_SOURCES += IPv6Addr_unittest.cc 13 | Misc_tests_SOURCES += DUID_unittest.cc 14 | Misc_tests_SOURCES += SPtr_unittest.cc 15 | Misc_tests_SOURCES += Container_unittest.cc 16 | 17 | Misc_tests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) 18 | 19 | Misc_tests_LDADD = $(GTEST_LDADD) 20 | Misc_tests_LDADD += $(top_builddir)/Misc/libMisc.a 21 | endif 22 | 23 | noinst_PROGRAMS = $(TESTS) 24 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgDecline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TClntMsgDecline; 12 | #ifndef CLNTMSGDECLINE_H 13 | #define CLNTMSGDECLINE_H 14 | #include "ClntMsg.h" 15 | 16 | class TClntMsgDecline : public TClntMsg 17 | { 18 | public: 19 | TClntMsgDecline(int iface, SPtr addr, List(TAddrIA) IALst); 20 | 21 | bool check(); 22 | 23 | void answer(SPtr Rep); 24 | void doDuties(); 25 | std::string getName() const; 26 | ~TClntMsgDecline(); 27 | private: 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /doc/TEST-METHOD: -------------------------------------------------------------------------------- 1 | Test 1.1 client.conf/server.conf 2 | Copy client.conf to /etc/dibbler 3 | Copy server.conf to /etc/dibbler 4 | run server 5 | run client 6 | Check that client does not report any errors. 7 | Check that server does not report any errors. 8 | 9 | 10 | Test 1.2 11 | Copy client-autodetect.conf to /etc/dibbler 12 | 13 | Test 1.3 Temporary addresses 14 | Copy client-ta.conf to /etc/dibbler 15 | 16 | 17 | Test 1.4 PD 18 | copy client-prefix-delegation.conf to /etc/dibbler 19 | 20 | Use wireshark. Make sure that prefixes are assigned properly. 21 | 22 | 23 | Test 1.5 PDx2 24 | Uncomment second pd-pool i /etc/dibbler/server.conf 25 | 26 | 27 | Test 1.6 stateless 28 | 29 | Test 1.7 anynymous stateless 30 | 31 | -------------------------------------------------------------------------------- /Options/OptIA_NA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TOptIA_NA; 12 | #ifndef OPTIA_NA_H 13 | #define OPTIA_NA_H 14 | 15 | #include "OptIA.h" 16 | 17 | class TOptIA_NA : public TOptIA 18 | { 19 | public: 20 | TOptIA_NA(long IAID, long t1, long t2, TMsg* parent); 21 | TOptIA_NA(char* &buf, int &bufsize, TMsg* parent); 22 | size_t getSize(); 23 | 24 | unsigned long getMaxValid(); 25 | int countAddrs(); 26 | 27 | char * storeSelf( char* buf); 28 | bool isValid() const; 29 | }; 30 | 31 | 32 | #endif /* */ 33 | -------------------------------------------------------------------------------- /bison++/bison.cld: -------------------------------------------------------------------------------- 1 | ! 2 | ! VMS BISON command definition file 3 | ! 4 | DEFINE VERB BISON 5 | IMAGE GNU_BISON:[000000]BISON 6 | 7 | PARAMETER P1,Label=BISON$INFILE,Prompt="File" 8 | value(required,type=$infile) 9 | QUALIFIER VERBOSE,Label=BISON$VERBOSE 10 | QUALIFIER DEFINES,Label=BISON$DEFINES 11 | QUALIFIER FIXED_OUTFILES,Label=BISON$FIXED_OUTFILES 12 | qualifier nolines,Label=BISON$NOLINES 13 | qualifier debug,Label=BISON$DEBUG 14 | qualifier output,value(type=$outfile),Label=BISON$OUTPUT 15 | qualifier version,label=BISON$VERSION 16 | qualifier yacc,label=BISON$YACC 17 | qualifier file_prefix,value(type=$outfile),label=BISON$FILE_PREFIX 18 | qualifier name_prefix,value(type=$outfile),LABEL=BISON$NAME_PREFIX 19 | -------------------------------------------------------------------------------- /Options/OptReconfigureMsg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Grzegorz Pluto 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef OPTRECONFIGURE_H 11 | #define OPTRECONFIGURE_H 12 | 13 | #include "DHCPConst.h" 14 | #include "Opt.h" 15 | 16 | class TOptReconfigureMsg : public TOpt 17 | { 18 | public: 19 | TOptReconfigureMsg(int msgType, TMsg* parent); 20 | TOptReconfigureMsg(char *buf, int bufsize, TMsg* parent); 21 | size_t getSize(); 22 | 23 | char* storeSelf(char* buf); 24 | bool doDuties() { return true; } 25 | bool isValid() const; 26 | protected: 27 | uint8_t MsgType_; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Port-linux/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libLowLevel.a 2 | 3 | libLowLevel_a_CFLAGS = -std=c99 4 | libLowLevel_a_CPPFLAGS = -I$(top_srcdir)/Misc 5 | 6 | libLowLevel_a_SOURCES = daemon.cpp daemon.h ethtool-kernel.h ethtool-local.h interface.c interface.h ip_common.h iproute.c libnetlink.c libnetlink.h ll_map.c ll_map.h ll_types.c lowlevel-linux.c lowlevel-linux-link-state.c lowlevel-options-linux.c rtm_map.h rt_names.h utils.c utils.h 7 | 8 | # that's ugly hack. Those files should not be built here. They are compiled during link of respective daemons. 9 | # As far as this makefile is concerned, they should be treated as data, so they are included in make dist 10 | dist_noinst_DATA = dibbler-client.cpp dibbler-relay.cpp dibbler-server.cpp 11 | -------------------------------------------------------------------------------- /RelOptions/RelOptRelayMsg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | * $Id: RelOptRelayMsg.cpp,v 1.2 2005-01-11 23:35:22 thomson Exp $ 10 | * 11 | * $Log: not supported by cvs2svn $ 12 | * Revision 1.1 2005/01/11 22:53:36 thomson 13 | * Relay skeleton implemented. 14 | * 15 | */ 16 | 17 | #include "OptGeneric.h" 18 | #include "RelOptRelayMsg.h" 19 | 20 | TRelOptRelayMsg::TRelOptRelayMsg(char* buf, int bufsize, TMsg* parent) 21 | :TOptGeneric(OPTION_RELAY_MSG, buf, bufsize, parent){ 22 | } 23 | 24 | bool TRelOptRelayMsg::doDuties() { 25 | return true; 26 | } 27 | -------------------------------------------------------------------------------- /ClntCfgMgr/ClntParsAddrOpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * Released under GNU GPL v2 licence 8 | * 9 | * $Id: ClntParsAddrOpt.h,v 1.2 2004-10-25 20:45:52 thomson Exp $ 10 | * 11 | * $Log: not supported by cvs2svn $ 12 | */ 13 | 14 | #ifndef CLNTPARSADDROPT_H 15 | #define CLNTPARSADDROPT_H 16 | 17 | #include "DHCPConst.h" 18 | 19 | class TClntParsAddrOpt 20 | { 21 | public: 22 | TClntParsAddrOpt(); 23 | long getPref(); 24 | void setPref(long pref); 25 | 26 | long getValid(); 27 | void setValid(long valid); 28 | 29 | private: 30 | long Pref; 31 | long Valid; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgRelease.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * changes: Krzysztof Wnuk 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TSrvMsgRelease; 12 | #ifndef SRVMSGRELEASE_H 13 | #define SRVMSGRELEASE_H 14 | 15 | #include "SrvMsg.h" 16 | 17 | class TSrvMsgRelease : public TSrvMsg 18 | { 19 | public: 20 | TSrvMsgRelease(int iface, SPtr addr, char* buf, int bufSize); 21 | 22 | void doDuties(); 23 | unsigned long getTimeout(); 24 | bool check(); 25 | std::string getName() const; 26 | ~TSrvMsgRelease(); 27 | }; 28 | #endif /* SRVMSGRELEASE_H */ 29 | -------------------------------------------------------------------------------- /AddrMgr/AddrPrefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Krzysztof Wnuk 5 | * changes: Tomasz Mrugalski 6 | * 7 | */ 8 | 9 | #ifndef ADDRPREFIX_H 10 | #define ADDRPREFIX_H 11 | 12 | #include 13 | #include "IPv6Addr.h" 14 | #include "AddrAddr.h" 15 | #include "SmartPtr.h" 16 | #include "DHCPConst.h" 17 | 18 | class TAddrPrefix: public TAddrAddr 19 | { 20 | friend std::ostream & operator<<(std::ostream & strum,TAddrPrefix &x); 21 | public: 22 | 23 | TAddrPrefix(SPtr addr, long pref, long valid, int length); 24 | 25 | // return address in packed format (char[16]) 26 | int getLength(); 27 | 28 | private: 29 | int Length; 30 | }; 31 | #endif 32 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgAdvertise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef SRVMSGADVERTISE_H 12 | #define SRVMSGADVERTISE_H 13 | 14 | #include "SrvMsg.h" 15 | class TSrvMsgAdvertise : public TSrvMsg 16 | { 17 | public: 18 | // creates object based on a buffer 19 | TSrvMsgAdvertise(SPtr question); 20 | 21 | bool check(); 22 | bool handleSolicitOptions(SPtr solicit); 23 | void doDuties(); 24 | unsigned long getTimeout(); 25 | std::string getName() const; 26 | ~TSrvMsgAdvertise(); 27 | }; 28 | 29 | #endif /* SRVMSGADVERTISE_H */ 30 | -------------------------------------------------------------------------------- /doc/examples/server-extraopts.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file 3 | # 4 | # This config. file is considered all-purpose as it instructs server 5 | # to provide almost every configuratio 6 | # 7 | 8 | # Logging level range: 1(Emergency)-8(Debug) 9 | log-level 8 10 | 11 | # Don't log full date 12 | log-mode short 13 | 14 | # set preference of this server to 0 (higher = more prefered) 15 | preference 0 16 | 17 | # adding extra option is experimental. This allows non-standard/extra behavior 18 | experimental 19 | 20 | iface "eth0" { 21 | 22 | # assign addresses from this pool 23 | class { 24 | pool 2001:db8::/64 25 | } 26 | 27 | # send those extra options to the client 28 | option extra 1234-0x012345679abcdef,7777-0x01,8888-0x8888 29 | } 30 | -------------------------------------------------------------------------------- /bison++/Example/Makefile: -------------------------------------------------------------------------------- 1 | 2 | .SUFFIXES : .cc .y .l $(SUFFIXES) 3 | 4 | .cc.o : 5 | g++ -g -I . -I$(CENTERCCLIBDIR)/incl -c $*.cc 6 | 7 | .y.cc : 8 | bison++ -d -o $*.cc -h $*.h $*.y 9 | .l.cc : 10 | flex++ -o$*.cc $*.l 11 | .y.h : 12 | bison++ -d -o $*.cc -h $*.h $*.y 13 | .l.h : 14 | flex++ -o$*.cc $*.l 15 | 16 | # COMPILER SAMPLE 17 | 18 | MyCompiler.o : MyCompiler.cc MyParser.h MyScanner.h 19 | 20 | MyParser.o : MyParser.cc MyParser.h 21 | 22 | MyScanner.o : MyScanner.cc MyScanner.h MyParser.h 23 | 24 | MyParser.cc : MyParser.y 25 | 26 | MyScanner.cc : MyScanner.l 27 | 28 | MyParser.h : MyParser.y 29 | 30 | MyScanner.h : MyScanner.l 31 | 32 | compiler : MyCompiler.o MyParser.o MyScanner.o 33 | g++ -o $@ MyCompiler.o MyParser.o MyScanner.o 34 | 35 | -------------------------------------------------------------------------------- /Port-win32/stdbool.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _STDBOOL_H 4 | #define _STDBOOL_H 5 | 6 | #include 7 | 8 | /* C99 Boolean types for compilers without C99 support */ 9 | /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */ 10 | #if !defined(__cplusplus) 11 | 12 | /* _Bool builtin type is included in GCC */ 13 | /* ISO C Standard: 5.2.5 An object declared as 14 | type _Bool is large enough to store 15 | the values 0 and 1. */ 16 | /* We choose 8 bit to match C++ */ 17 | /* It must also promote to integer */ 18 | #ifndef WIN32 19 | typedef uint8_t _Bool; 20 | #endif 21 | 22 | /* ISO C Standard: 7.16 Boolean type */ 23 | #define bool _Bool 24 | #define true 1 25 | #define false 0 26 | #define __bool_true_false_are_defined 1 27 | 28 | #endif 29 | 30 | #endif -------------------------------------------------------------------------------- /doc/examples/client-prefix-delegation.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: Prefix Delegation 3 | # 4 | 5 | # This is an example configuration file with prefix delegation 6 | # enabled. To ask for prefixes, use 'pd' (or 'prefix-delegation') keyword. 7 | 8 | log-mode short 9 | 10 | # 7 = omit debug messages 11 | log-level 7 12 | 13 | # Dibbler-client will attempt to try selecting downlink interfaces automatically. 14 | # Usually it does its job right, but if you have fancy setup it may be better 15 | # to specify them explicitly 16 | #downlink-prefix-ifaces eth0, "eth4", "wifi0" 17 | 18 | iface "eth0" { 19 | ia 20 | pd 21 | 22 | # it is also possible to define requested parameters for prefix delegation 23 | # pd { 24 | # t1 1000 25 | # t2 2000 26 | #} 27 | 28 | } 29 | -------------------------------------------------------------------------------- /RelMessages/RelMsgRelayRepl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TRelMsgRelayRepl; 12 | #ifndef RELMSGRELAYREPL_H 13 | #define RELMSGRELAYREPL_H 14 | 15 | #include "RelMsg.h" 16 | 17 | #define MIN_RELAYREPL_LEN 34 18 | 19 | class TRelMsgRelayRepl: public TRelMsg { 20 | public: 21 | TRelMsgRelayRepl(int iface, SPtr addr, char * data, int dataLen); 22 | int getSize(); 23 | int storeSelf(char * buffer); 24 | std::string getName() const; 25 | bool check(); 26 | 27 | private: 28 | SPtr PeerAddr; 29 | SPtr LinkAddr; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgReconfigure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Grzegorz Pluto 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef SRVMSGRECONFIGURE_H 12 | #define SRVMSGRECONFIGURE_H 13 | 14 | #include "SrvMsg.h" 15 | #include "SrvMsgSolicit.h" 16 | class TSrvMsgReconfigure : public TSrvMsg 17 | { 18 | public: 19 | // creates object based on a buffer 20 | TSrvMsgReconfigure(int iface, SPtr clientAddr, 21 | int msgType, SPtr clientDuid); 22 | 23 | bool check(); 24 | void doDuties(); 25 | unsigned long getTimeout(); 26 | std::string getName() const; 27 | ~TSrvMsgReconfigure(); 28 | }; 29 | 30 | #endif /* SRVMSGRECONFIGURE_H */ 31 | -------------------------------------------------------------------------------- /bison++/Example/MyCompiler.cc: -------------------------------------------------------------------------------- 1 | #include "MyParser.h" 2 | #define YY_DECL int yyFlexLexer::yylex(YY_MyParser_STYPE *val) 3 | #include "FlexLexer.h" 4 | #include 5 | 6 | class MyCompiler : public MyParser 7 | { 8 | private: 9 | yyFlexLexer theScanner; 10 | public: 11 | virtual int yylex(); 12 | virtual void yyerror(char *m); 13 | MyCompiler(){;} 14 | }; 15 | 16 | int MyCompiler::yylex() 17 | { 18 | return theScanner.yylex(&yylval); 19 | } 20 | 21 | void MyCompiler::yyerror(char *m) 22 | { fprintf(stderr,"%d: %s at token '%s'\n",yylloc.first_line, m,yylloc.text); 23 | } 24 | 25 | int main(int argc,char **argv) 26 | { 27 | MyCompiler aCompiler; 28 | int result=aCompiler.yyparse(); 29 | printf("Resultat Parsing=%s\n",result?"Erreur":"OK"); 30 | return 0; 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /ClntCfgMgr/ClntCfgTA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | #ifndef CLNTCFGTA_H 12 | #define CLNTCFGTA_H 13 | 14 | #include "ClntParsGlobalOpt.h" 15 | #include "DHCPConst.h" 16 | #include 17 | #include 18 | 19 | class TClntCfgTA 20 | { 21 | friend std::ostream& operator<<(std::ostream& out,TClntCfgTA& ta); 22 | public: 23 | TClntCfgTA(); 24 | unsigned long getIAID(); 25 | void setIAID(unsigned long iaid); 26 | void setState(enum EState state); 27 | enum EState getState(); 28 | 29 | private: 30 | unsigned long iaid; 31 | EState State; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Options/OptEmpty.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | */ 10 | #include 11 | #include "Portable.h" 12 | #include "OptEmpty.h" 13 | 14 | TOptEmpty::TOptEmpty(int code, const char * buf, int n, TMsg* parent) 15 | :TOpt(code, parent) { 16 | if (n) { 17 | Valid = false; 18 | } 19 | } 20 | 21 | TOptEmpty::TOptEmpty(int code, TMsg* parent) 22 | :TOpt(code, parent) { 23 | } 24 | 25 | size_t TOptEmpty::getSize() { 26 | return 4; 27 | } 28 | 29 | char * TOptEmpty::storeSelf( char* buf) { 30 | buf = writeUint16(buf, OptType); 31 | buf = writeUint16(buf, getSize()-4); 32 | return buf; 33 | } 34 | -------------------------------------------------------------------------------- /tests/DnsUpdate/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR=../.. 2 | 3 | OBJECTS = DnsUpdate01.o DnsUpdate02.o 4 | 5 | TESTS = DnsUpdate01 DnsUpdate02 6 | 7 | tests: $(TESTS) 8 | 9 | objs: $(OBJECTS) 10 | 11 | libs: testDnsUpdate.a 12 | 13 | include $(TOPDIR)/Makefile.inc 14 | 15 | DnsUpdate01: DnsUpdate01.cpp 16 | $(CXX) $(CPPFLAGS) -o DnsUpdate01 $< 17 | $(LD) $< -L$(TOPDIR)/Misc -lMisc \ 18 | -L$(TOPDIR)/IfaceMgr -lIfaceMgr 19 | 20 | DnsUpdate02: DnsUpdate02.cpp 21 | cd $(TOPDIR); make libposlib 22 | cd $(MISC); make libs 23 | cd $(SRVIFACEMGR); make libs 24 | $(CXX) $(CXXFLAGS) -o DnsUpdate02 $< -L$(TOPDIR)/Misc -lMisc \ 25 | -L$(TOPDIR)/IfaceMgr -lIfaceMgr \ 26 | -L$(TOPDIR)/SrvIfaceMgr -lSrvIfaceMgr \ 27 | -L$(POSLIB) -lposlib \ 28 | -L$(MISC) -lMisc 29 | 30 | -------------------------------------------------------------------------------- /.github/workflows/gtest.yml: -------------------------------------------------------------------------------- 1 | name: gtest run 2 | 3 | on: 4 | push: 5 | branches: [ master, ci-update ] 6 | pull_request: 7 | branches: [ master, ci-update ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v3 16 | 17 | - name: install gtest 18 | run: | 19 | curl -L -o gtest.tar.gz https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz 20 | tar zxvf gtest.tar.gz 21 | 22 | - name: configure 23 | run: ./configure --with-gtest-source=${{ github.workspace }}/googletest-release-1.12.1 24 | 25 | - name: make 26 | run: make -j2 27 | 28 | - name: make check 29 | run: make check 30 | 31 | - name: make distcheck 32 | run: make distcheck 33 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgReply.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * changes: Krzysztof Wnuk 7 | * 8 | * released under GNU GPL v2 only licence 9 | * 10 | */ 11 | 12 | class TClntMsgReply; 13 | #ifndef CLNTMSGREPLY_H 14 | #define CLNTMSGREPLY_H 15 | #include "ClntMsg.h" 16 | 17 | class TClntMsgReply : public TClntMsg 18 | { 19 | public: 20 | TClntMsgReply(int iface, SPtr addr, char* buf, int bufSize); 21 | 22 | SPtr getFirstAddr(); 23 | void answer(SPtr Rep); 24 | void doDuties(); 25 | bool check(); 26 | std::string getName() const; 27 | ~TClntMsgReply(); 28 | }; 29 | 30 | #endif /* CLNTMSGREPLY_H */ 31 | -------------------------------------------------------------------------------- /RelMessages/RelMsgRelayForw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef RELMSGRELAYFORW_H 12 | #define RELMSGRELAYFORW_H 13 | 14 | #include "RelMsg.h" 15 | #include "IPv6Addr.h" 16 | 17 | #define MIN_RELAYFORW_LEN 34 18 | 19 | class TRelMsgRelayForw: public TRelMsg { 20 | 21 | public: 22 | TRelMsgRelayForw(int iface, SPtr addr, char * data, int dataLen); 23 | std::string getName() const; 24 | bool check(); 25 | 26 | int storeSelf(char * buffer); 27 | int getSize(); 28 | 29 | private: 30 | SPtr PeerAddr; 31 | SPtr LinkAddr; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /doc/dibbler-devel-07-debug.dox: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @page debug 7. Dibbler debugging 4 | 5 | This section specifies, which tools can be used to debug Dibbler and 6 | generally aid in the software process development. 7 | 8 | @section debugMemoryLeaks 7.1 Detecting Memory Leaks using Valgrind 9 | 10 | Execute dibbler with the following command: 11 | @verbatim 12 | valgrind --tool=memcheck --show-reachable=yes --leak-check=full ./dibbler-client run 13 | @endverbatim 14 | 15 | @section debugCppcheck 7.2 Static code analysis using cppcheck 16 | 17 | Code is automatically checked using cppcheck 18 | tool, with all possible checks enabled (--enable=all). The goal is to have Dibbler code cppcheck 19 | clean. Sadly, we are currently far away from that goal. 20 | 21 | */ -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /scripts/hdr_strip: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | $name = $ARGV[0]; 4 | 5 | print "FILE: $name\n"; 6 | 7 | $file = open(FILE, $name) or die "Unable to open $name file."; 8 | @tmptable = ; 9 | $data = join "", @tmptable; 10 | close(FILE); 11 | 12 | # GOOD $logPattern = '/\*[^*]*\*+([^/*][^*]*\*+)*/'; 13 | #$logPattern = '(/\*[^*]*\*+([^/*][^*]*\*+)*/)'; 14 | $logPattern = '(/\*[^*]*\*+([^/*][^*])*Log([^/*][^*]*\*+)*/)'; 15 | 16 | $hdrPattern = '(/\*[^*]*\*+([^/*])*GNU([^/*][^*]*\*+)*/)'; 17 | 18 | #if ($data =~ s%$logPattern%LOG%smg) { 19 | #$cmt = $1; 20 | #} 21 | 22 | if ($data =~ s%$hdrPattern%HDR%smg) { 23 | $hdr = $1; 24 | } 25 | 26 | #$data =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse; 27 | 28 | print "====\n$data===$cmt===\n$hdr===\n"; 29 | -------------------------------------------------------------------------------- /AddrMgr/tests/AddrIA_unittest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | using namespace std; 8 | 9 | namespace test { 10 | 11 | TEST(AddrIATest, constructor) { 12 | SPtr addr = new TIPv6Addr("fe80::abcd", true); 13 | 14 | const char duidData[] = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6}; 15 | SPtr duid = new TDUID(duidData, sizeof(duidData)); 16 | 17 | SPtr ia = new TAddrIA("eth0", 1, IATYPE_IA, addr, duid, 100, 200, 300); 18 | 19 | EXPECT_EQ(1, ia->getIfindex()); 20 | EXPECT_EQ(100u, ia->getT1()); 21 | EXPECT_EQ(200u, ia->getT2()); 22 | EXPECT_EQ(300u, ia->getIAID()); 23 | EXPECT_EQ(string("fe80::abcd"), ia->getSrvAddr()->getPlain()); 24 | EXPECT_EQ(0, ia->countAddr()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgInfRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TClntIfaceMgr; 12 | #ifndef CLNTMSGINFREQUEST_H 13 | #define CLNTMSGINFREQUEST_H 14 | 15 | #include "SmartPtr.h" 16 | #include "ClntMsg.h" 17 | #include "ClntCfgMgr.h" 18 | 19 | class TClntMsgInfRequest : public TClntMsg 20 | { 21 | public: 22 | TClntMsgInfRequest(TOptList ReqOpts, int iface); 23 | TClntMsgInfRequest(SPtr iface); 24 | 25 | void answer(SPtr msg); 26 | void doDuties(); 27 | bool check(); 28 | std::string getName() const; 29 | ~TClntMsgInfRequest(); 30 | }; 31 | 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /tests/3.2-relay/relay1.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode short 3 | 4 | # messages will be forwarded on this interface using multicast 5 | #iface eth1 { 6 | # server multicast yes // relay messages on this interface to ff05::1:3 7 | # server unicast 6010::1 // relay messages on this interface to this global address 8 | #} 9 | 10 | iface eth2 { 11 | server multicast yes // relay messages on this interface to ff05::1:3 12 | # server unicast 6011::1 // relay messages on this interface to this global address 13 | } 14 | 15 | # client can send messages to multicast 16 | # (or specific link-local addr) on this link 17 | iface eth0 { 18 | client multicast yes // bind ff02::1:2 19 | # client unicast 6021::1 // bind this address 20 | interface-id 6021 21 | } 22 | -------------------------------------------------------------------------------- /doc/dibbler-devel-01-intro.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | @page intro 1. Introduction 4 | Welcome to the Dibbler developer's guide. This document describes 5 | various aspects of the compilation and installation of Dibbler server 6 | and client. Detailed description of the internal architecture is also 7 | provided. People with programming background can find useful 8 | informations here. Main purpose of this document is to help 9 | contributors to quickly know Dibbler from the inside. 10 | 11 | This document is intenteded just as its title states -- a guide. It is 12 | not a thorough code description. To quickly wander around classes and 13 | methods used, see documentation generated with the Doxygen tool (open 14 | file doc/html/index.html ). More informations about 15 | documentation is provided in section @ref generalDocs. 16 | 17 | */ 18 | -------------------------------------------------------------------------------- /tests/Logger/basic01.cpp: -------------------------------------------------------------------------------- 1 | #include "Logger.h" 2 | #include 3 | 4 | using namespace std; 5 | 6 | int main() { 7 | 8 | ostringstream strum; 9 | strum << "dupa"; 10 | 11 | logger::setLogLevel(6); 12 | logger::Initialize("foo.log"); 13 | Log(Debug) << "Entry Debug: str=" << LogEnd; 14 | Log(Info) << "Entry Info: str=" << LogEnd; 15 | Log(Notice) << "Entry Notice: str=" << strum.str() << LogEnd; 16 | Log(Warning) << "Entry Warning: str=" << strum.str() << LogEnd; 17 | Log(Error) << "Entry Error: str=" << strum.str() << LogEnd; 18 | Log(Crit) << "Entry Crit: str=" << strum.str() << LogEnd; 19 | Log(Alert) << "Entry Alert: str=" << strum.str() << LogEnd; 20 | Log(Emerg) << "Entry Emerg: str=" << strum.str() << LogEnd; 21 | logger::Terminate(); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /Port-linux/gentoo/net-misc/dibbler/Manifest: -------------------------------------------------------------------------------- 1 | MD5 bcc14088cee45e4aeacff9ed3b7b5c88 dibbler-0.4.0.ebuild 1232 2 | MD5 83fe2f6c672bdeeee9e08f76144cfa7d dibbler-0.3.1.ebuild 1749 3 | MD5 d1a0e7d14ac4489fcf24611f2a593c82 ChangeLog 429 4 | MD5 8d1e21e717902e6fe802cdde5c9f7636 dibbler-0.4.1.ebuild 1481 5 | MD5 d4ce9ce404872e1d5e22aa6953d16418 metadata.xml 220 6 | MD5 d0884f6657a9788f842f6d8dea21bc93 files/digest-dibbler-0.3.1 70 7 | MD5 599f32c13b80d37c46f94fa94cc2c961 files/digest-dibbler-0.4.1 140 8 | MD5 2ec8af101d52b7fdbc1aa209f870d0e0 files/dibbler-relay 470 9 | MD5 e61e7a9df41a05cdad37bac9ef97c3e9 files/dibbler-0.3.1-security.patch 6876 10 | MD5 981b49e7c0f0189b77ac6a0dff6eda69 files/dibbler-client 477 11 | MD5 18841c91f6e669b04a01d79652c8da03 files/dibbler-0.4.1.ebuild 1247 12 | MD5 d0b0d0023bb1c0a6da51c926a10e2a6e files/dibbler-server 477 13 | -------------------------------------------------------------------------------- /Port-win32/ClntService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef CLNTSERVICE_H 11 | #define CLNTSERVICE_H 12 | 13 | #include "winservice.h" 14 | 15 | class TClntService; 16 | extern TClntService StaticService; 17 | 18 | class TClntService : public TWinService 19 | { 20 | public: 21 | TClntService(void); 22 | void Run(); 23 | void OnStop(); 24 | void OnShutdown(); 25 | ~TClntService(void); 26 | EServiceState ParseStandardArgs(int argc, char* argv[]); 27 | void setState(EServiceState status); 28 | static TClntService * getHandle() { return &StaticService; } 29 | 30 | private: 31 | EServiceState status; 32 | 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgInfRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef SRVINFREQUEST_H 12 | #define SRVINFREQUEST_H 13 | 14 | #include "SmartPtr.h" 15 | #include "SrvMsg.h" 16 | #include "IPv6Addr.h" 17 | 18 | class TSrvMsgInfRequest : public TSrvMsg 19 | { 20 | public: 21 | TSrvMsgInfRequest(int iface, SPtr addr, char* buf, int bufSize); 22 | void doDuties(); 23 | bool check(); 24 | unsigned long getTimeout(); 25 | std::string getName() const; 26 | ~TSrvMsgInfRequest(); 27 | private: 28 | SPtr AddrMgr; 29 | List(TMsg) BackupSrvLst; 30 | }; 31 | 32 | 33 | #endif /* SRVMSGINFREQUEST_H */ 34 | -------------------------------------------------------------------------------- /Misc/KeyList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Michal Kowalczuk 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include "Portable.h" 13 | 14 | #ifndef KEYLIST_FILE_HEADER_INC 15 | #define KEYLIST_FILE_HEADER_INC 16 | 17 | struct KeyListElement { 18 | // client-server SPI 19 | uint32_t SPI; 20 | 21 | uint32_t AAASPI; 22 | char * AuthInfoKey; 23 | 24 | KeyListElement * next; 25 | }; 26 | 27 | class KeyList { 28 | public: 29 | KeyList(): beginning(NULL) {} 30 | ~KeyList(); 31 | void Add(uint32_t SPI, uint32_t AAASPI, char * AuthInfoKey); 32 | void Del(uint32_t SPI); 33 | char * Get(uint32_t SPI); 34 | protected: 35 | KeyListElement * beginning; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /SrvCfgMgr/SrvCfgClientClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Nguyen Vinh Nghiem 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 or later licence 8 | * 9 | */ 10 | 11 | #ifndef SRVCFGCLIENTCLASS_H_ 12 | #define SRVCFGCLIENTCLASS_H_ 13 | 14 | #include 15 | #include "SmartPtr.h" 16 | #include "Node.h" 17 | 18 | class TSrvCfgClientClass { 19 | public: 20 | TSrvCfgClientClass(); 21 | TSrvCfgClientClass(std::string); 22 | TSrvCfgClientClass(std::string , SPtr&); 23 | virtual ~TSrvCfgClientClass(); 24 | std::string getClassName(); 25 | SPtr getCondition(); 26 | bool isStatisfy(SPtr msg); 27 | private: 28 | std::string classname; 29 | SPtr condition; 30 | }; 31 | 32 | #endif /* SRVCFGCLIENTCLASS_H_ */ 33 | -------------------------------------------------------------------------------- /poslib/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir) 2 | AM_CPPFLAGS += -I$(top_srcdir)/Misc 3 | AM_CPPFLAGS += -I$(top_srcdir)/poslib 4 | AM_CPPFLAGS += -I$(top_srcdir)/nettle 5 | 6 | # This is to workaround long long in gtest.h 7 | AM_CPPFLAGS += $(GTEST_INCLUDES) -Wno-long-long -Wno-variadic-macros 8 | 9 | TESTS = 10 | if HAVE_GTEST 11 | TESTS += tsig_tests 12 | 13 | tsig_tests_SOURCES = run_tests.cc 14 | tsig_tests_SOURCES += tsig_unittest.cc 15 | 16 | tsig_tests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) 17 | 18 | tsig_tests_LDADD = $(GTEST_LDADD) 19 | tsig_tests_LDADD += $(top_builddir)/Misc/libMisc.a 20 | tsig_tests_LDADD += $(top_builddir)/poslib/libPoslib.a 21 | tsig_tests_LDADD += $(top_builddir)/nettle/libNettle.a 22 | tsig_tests_LDADD += $(top_builddir)/tests/utils/libTestUtils.a 23 | endif 24 | 25 | noinst_PROGRAMS = $(TESTS) 26 | -------------------------------------------------------------------------------- /Port-win32/RelService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef RELSERVICE_H 11 | #define RELSERVICE_H 12 | 13 | #include 14 | #include 15 | #include "winservice.h" 16 | #include "DHCPRelay.h" 17 | class TRelService; 18 | extern TRelService StaticService; 19 | 20 | class TRelService : public TWinService 21 | { 22 | public: 23 | TRelService(void); 24 | void Run(); 25 | void OnStop(); 26 | EServiceState ParseStandardArgs(int argc,char* argv[]); 27 | void setState(EServiceState status); 28 | static TRelService * getHandle() { return &StaticService; } 29 | ~TRelService(void); 30 | private: 31 | EServiceState status; 32 | }; 33 | 34 | #endif -------------------------------------------------------------------------------- /ClntMessages/ClntMsgRenew.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntMsgRenew.h,v 1.7 2008-08-29 00:07:28 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef CLNTMSGRENEW_H 14 | #define CLNTMSGRENEW_H 15 | #include "ClntMsg.h" 16 | #include "ClntOptIA_NA.h" 17 | 18 | class TClntMsgRenew : public TClntMsg 19 | { 20 | public: 21 | TClntMsgRenew(List(TAddrIA) IALst, List(TAddrIA) PDLst); 22 | 23 | void answer(SPtr Rep); 24 | void doDuties(); 25 | bool check(); 26 | std::string getName() const; 27 | ~TClntMsgRenew(); 28 | void updateIA(SPtr ptrOptIA); 29 | void releaseIA(long IAID); 30 | 31 | private: 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Port-win32/SrvService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef SRVSERVICE_H 11 | #define SRVSERVICE_H 12 | 13 | #include 14 | #include 15 | #include "winservice.h" 16 | #include "DHCPServer.h" 17 | 18 | class TSrvService; 19 | extern TSrvService StaticService; 20 | 21 | class TSrvService : public TWinService 22 | { 23 | public: 24 | TSrvService(void); 25 | void Run(); 26 | void OnStop(); 27 | EServiceState ParseStandardArgs(int argc,char* argv[]); 28 | void setState(EServiceState status); 29 | static TSrvService * getHandle() { return &StaticService; } 30 | ~TSrvService(void); 31 | private: 32 | EServiceState status; 33 | }; 34 | 35 | #endif -------------------------------------------------------------------------------- /bison++/README++: -------------------------------------------------------------------------------- 1 | this is a modified version of bison 2 | the author of the changes is coetmeur@icdc.fr 3 | 4 | all is quite like the standard bison install, except : 5 | 6 | 7 | the bison++.man are man page that shows the differences between 8 | bison and bison++ 9 | 10 | the bison++.dman is a very readable file that generate the 11 | not as much readable troff/man file bison++.man 12 | 13 | on DOS, use bison_pp.mak to build the DOS EXE with MSC7 14 | there are no big trick in it. it can be directly loaded in 15 | the PWB... 16 | if you want to use another compiler, just compile 17 | and link normally each source like on unix... 18 | use large memory model, and look at the -D option I have added 19 | in the MSC makefile... check also for compiler specific problems... 20 | 21 | you can else get the DOS exe that come normally aside this archive... 22 | 23 | -------------------------------------------------------------------------------- /Options/OptDUID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef OPTDUID_H 11 | #define OPTDUID_H 12 | 13 | #include "DHCPConst.h" 14 | #include "Opt.h" 15 | #include "DUID.h" 16 | #include "SmartPtr.h" 17 | 18 | class TOptDUID : public TOpt 19 | { 20 | public: 21 | TOptDUID(int type, SPtr duid, TMsg* parent); 22 | TOptDUID(int type, const char* buf, int len, TMsg* parent); 23 | size_t getSize(); 24 | 25 | char * storeSelf(char* buf); 26 | bool doDuties() { return true; } 27 | SPtr getDUID() const; 28 | virtual bool isValid() const; 29 | virtual std::string getPlain(); 30 | protected: 31 | SPtr DUID; 32 | }; 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Options/OptStatusCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #ifndef OPTSTATUSCODE_H 12 | #define OPTSTATUSCODE_H 13 | 14 | #include 15 | #include "Opt.h" 16 | 17 | class TOptStatusCode : public TOpt 18 | { 19 | public: 20 | TOptStatusCode(const char * buf, size_t len, TMsg* parent); 21 | TOptStatusCode(int status, const std::string& Message, TMsg* parent); 22 | 23 | virtual size_t getSize(); 24 | virtual char * storeSelf( char* buf); 25 | 26 | int getCode(); 27 | std::string getText(); 28 | 29 | virtual bool doDuties(); 30 | private: 31 | std::string Message_; 32 | int StatusCode_; 33 | bool Valid_; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ClntCfgMgr/ClntParsAddrOpt.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * Released under GNU GPL v2 licence 8 | * 9 | * $Id: ClntParsAddrOpt.cpp,v 1.3 2004-10-25 20:45:52 thomson Exp $ 10 | * 11 | * $Log: not supported by cvs2svn $ 12 | */ 13 | 14 | #include 15 | #include "ClntParsAddrOpt.h" 16 | 17 | TClntParsAddrOpt::TClntParsAddrOpt() 18 | { 19 | Pref=UINT_MAX; 20 | Valid=UINT_MAX; 21 | } 22 | 23 | long TClntParsAddrOpt::getPref() 24 | { 25 | return Pref; 26 | } 27 | 28 | void TClntParsAddrOpt::setPref(long pref) 29 | { 30 | this->Pref=pref; 31 | } 32 | 33 | long TClntParsAddrOpt::getValid() 34 | { 35 | return Valid; 36 | } 37 | 38 | void TClntParsAddrOpt::setValid(long valid) 39 | { 40 | Valid=valid; 41 | } 42 | -------------------------------------------------------------------------------- /Options/OptString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | #ifndef OPTSTRING_H 12 | #define OPTSTRING_H 13 | #include 14 | #include 15 | 16 | #include "Opt.h" 17 | 18 | class TOptString : public TOpt 19 | { 20 | public: 21 | TOptString(int type, std::string str, TMsg* parent); 22 | TOptString(int type, const char *buf, unsigned short len, TMsg* parent); 23 | char * storeSelf( char* buf); 24 | size_t getSize(); 25 | std::string getString(); 26 | virtual bool doDuties() { return true; } // do nothing, actual code in ClntOpt* classes 27 | std::string getPlain() { return Str; } 28 | protected: 29 | std::string Str; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /bison++/configure.ac: -------------------------------------------------------------------------------- 1 | # Process this file with autoconf to produce a configure script. 2 | PACKAGE=bison++ 3 | AC_INIT([bison++], [2.21.5-dibbler], [alain.coetmeur@caissedesdepots.fr]) 4 | AC_CONFIG_SRCDIR([bison.cc]) 5 | AM_INIT_AUTOMAKE 6 | 7 | # DO NOT trigger rebuild rules, unless I tell you so. 8 | AM_MAINTAINER_MODE([disable]) 9 | 10 | # Checks for programs. 11 | AC_PROG_AWK 12 | AC_PROG_CXX 13 | AC_PROG_CC 14 | AC_PROG_INSTALL 15 | AC_PROG_LN_S 16 | # Checks for libraries. 17 | 18 | # Checks for header files. 19 | AC_HEADER_STDC 20 | AC_CHECK_HEADERS([alloca.h malloc.h memory.h stddef.h stdlib.h string.h strings.h]) 21 | 22 | # Checks for typedefs, structures, and compiler characteristics. 23 | AC_C_CONST 24 | AC_TYPE_SIZE_T 25 | 26 | # Checks for library functions. 27 | AC_FUNC_ALLOCA 28 | AC_FUNC_MALLOC 29 | 30 | AC_CONFIG_FILES([Makefile]) 31 | AC_OUTPUT 32 | -------------------------------------------------------------------------------- /RelOptions/RelOptInterfaceID.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: RelOptInterfaceID.cpp,v 1.3 2008-08-29 00:07:32 thomson Exp $ 10 | * 11 | */ 12 | 13 | #include "RelOptInterfaceID.h" 14 | #include "DHCPConst.h" 15 | 16 | TRelOptInterfaceID::TRelOptInterfaceID(char * data, int dataLen, TMsg* parent) 17 | :TOptInteger(OPTION_INTERFACE_ID, 4 /** @todo: Support length other than 4 */, data, dataLen, parent) { 18 | } 19 | 20 | TRelOptInterfaceID::TRelOptInterfaceID(int interfaceID, TMsg* parent) 21 | :TOptInteger(OPTION_INTERFACE_ID, 4 /** @todo: Support length other than 4 */, interfaceID, parent) { 22 | } 23 | 24 | bool TRelOptInterfaceID::doDuties() { 25 | return true; 26 | } 27 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgRelease.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #include "SrvMsgRelease.h" 12 | #include "AddrClient.h" 13 | 14 | TSrvMsgRelease::TSrvMsgRelease(int iface, SPtr addr, char* buf, int bufSize) 15 | :TSrvMsg(iface, addr, buf, bufSize) 16 | { 17 | } 18 | 19 | void TSrvMsgRelease::doDuties() { 20 | } 21 | 22 | unsigned long TSrvMsgRelease::getTimeout() { 23 | return 0; 24 | } 25 | 26 | bool TSrvMsgRelease::check() { 27 | return TSrvMsg::check(true /* ClientID required */, true /* ServerID required */); 28 | } 29 | 30 | std::string TSrvMsgRelease::getName() const { 31 | return "RELEASE"; 32 | } 33 | 34 | TSrvMsgRelease::~TSrvMsgRelease() { 35 | } 36 | -------------------------------------------------------------------------------- /ClntOptions/ClntOptPreference.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntOptPreference.h,v 1.3 2008-08-29 00:07:29 thomson Exp $ 10 | * 11 | * $Log: not supported by cvs2svn $ 12 | * Revision 1.2 2004-10-25 20:45:53 thomson 13 | * Option support, parsers rewritten. ClntIfaceMgr now handles options. 14 | * 15 | * 16 | */ 17 | 18 | #ifndef CLNTPREFERENCE_H 19 | #define CLNTPREFERENCE_H 20 | 21 | #include "DHCPConst.h" 22 | #include "OptInteger.h" 23 | 24 | class TClntOptPreference : public TOptInteger 25 | { 26 | public: 27 | TClntOptPreference( char * buf, int n, TMsg* parent); 28 | 29 | TClntOptPreference( char pref, TMsg* parent); 30 | bool doDuties(); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Misc/Key.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 licence 7 | */ 8 | 9 | #ifndef KEY_H 10 | #define KEY_H 11 | 12 | #include 13 | #include "SmartPtr.h" 14 | #include "DHCPConst.h" 15 | #include "Portable.h" 16 | 17 | typedef std::vector TKey; 18 | 19 | class TSIGKey { 20 | public: 21 | TSIGKey(const std::string& name); 22 | std::string getAlgorithmText(); 23 | 24 | bool setData(const std::string& base64encoded); 25 | std::string getPackedData(); 26 | std::string getBase64Data(); 27 | 28 | DigestTypes Digest_; 29 | std::string Name_; 30 | uint16_t Fudge_; 31 | protected: 32 | std::string Data_; 33 | std::string Base64Data_; 34 | }; 35 | 36 | typedef std::vector< SPtr > TSIGKeyList; 37 | 38 | #endif /* KEY_H */ 39 | -------------------------------------------------------------------------------- /Port-linux/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * changes: Michal Kowalczuk 7 | * 8 | * released under GNU GPL v2 only licence 9 | */ 10 | 11 | #ifndef DAEMON_H 12 | #define DAEMON_H 13 | 14 | #ifndef SIGTERM 15 | #define SIGTERM 15 16 | #endif 17 | 18 | #ifndef SIGINT 19 | #define SIGINT 2 20 | #endif 21 | 22 | int start(const char * pidfile, const char * workdir); 23 | int stop(const char * pidfile); 24 | 25 | int init(const char * pidfile, const char * workdir); 26 | pid_t getPID(char * pidfile); 27 | int getServerPID(); 28 | int getClientPID(); 29 | int getRelayPID(); 30 | int die(const char * pidfile); 31 | 32 | void logStart(const char * note, const char * logname, const char * logfile); 33 | void logEnd(); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgRenew.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #include "SrvMsgRenew.h" 12 | #include "SrvCfgMgr.h" 13 | #include "DHCPConst.h" 14 | 15 | TSrvMsgRenew::TSrvMsgRenew(int iface, SPtr addr, char* buf, int bufSize) 16 | :TSrvMsg(iface,addr,buf,bufSize) { 17 | 18 | } 19 | 20 | void TSrvMsgRenew::doDuties() { 21 | } 22 | 23 | unsigned long TSrvMsgRenew::getTimeout() { 24 | return 0; 25 | } 26 | 27 | bool TSrvMsgRenew::check() { 28 | return TSrvMsg::check(true /* ClientID required */, true /* ServerID required */); 29 | } 30 | 31 | std::string TSrvMsgRenew::getName() const { 32 | return "RENEW"; 33 | } 34 | 35 | TSrvMsgRenew::~TSrvMsgRenew() { 36 | } 37 | -------------------------------------------------------------------------------- /SrvOptions/SrvOptFQDN.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Krzysztof Wnuk 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | * $Id: SrvOptFQDN.h,v 1.4 2008-08-29 00:07:36 thomson Exp $ 9 | * 10 | * $Log: not supported by cvs2svn $ 11 | * Revision 1.3 2006-10-06 00:37:59 thomson 12 | * Initial PD support. 13 | * 14 | * Revision 1.2 2006-03-03 20:49:54 thomson 15 | * FQDN support improved. 16 | * 17 | * Revision 1.1 2004/11/02 01:30:54 thomson 18 | * Initial version. 19 | * 20 | */ 21 | 22 | #ifndef SRVOPTFQDN_H 23 | #define SRVOPTFQDN_H 24 | 25 | #include "OptFQDN.h" 26 | 27 | class TSrvOptFQDN : public TOptFQDN 28 | { 29 | public: 30 | TSrvOptFQDN(const std::string& fqdn, TMsg* parent); 31 | TSrvOptFQDN(char *buf, int bufsize, TMsg* parent); 32 | bool doDuties(); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /doc/examples/server-client-classification.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file: client classification on the server 3 | # 4 | # Server assigns clients to one of defined client classes. 5 | # Then selects pool based on which class the client was 6 | # assigned to. 7 | # 8 | 9 | log-level 8 10 | log-mode short 11 | 12 | 13 | Client-class TelephoneClass{ 14 | match-if ( client.vendor-spec.en == 1234567) 15 | } 16 | 17 | Client-class CpeDevices { 18 | match-if ( client.vendor-class.data contain CPE ) 19 | } 20 | 21 | iface eth0 { 22 | 23 | class { 24 | pool 2001:db8:1::/64 25 | #deny TelephoneClass 26 | allow CpeDevices 27 | } 28 | 29 | class { 30 | pool 2001:db8:2::/64 31 | allow TelephoneClass 32 | #deny CpeDevices 33 | } 34 | 35 | class { 36 | pool 2001:db8:3::/64 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Options/OptIA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #include 11 | #include "Opt.h" 12 | 13 | #ifndef OPTIA_H 14 | #define OPTIA_H 15 | 16 | class TOptIA : public TOpt 17 | { 18 | public: 19 | TOptIA(uint16_t type, uint32_t iaid, uint32_t t1, uint32_t t2, TMsg* parent); 20 | TOptIA(uint16_t type, TMsg* parent); 21 | 22 | unsigned long getIAID() const; 23 | unsigned long getT1() const; 24 | unsigned long getT2() const; 25 | void setT1(unsigned long t1); 26 | void setT2(unsigned long t2); 27 | void setIAID(uint32_t iaid); 28 | 29 | int getStatusCode(); 30 | 31 | protected: 32 | unsigned long IAID_; 33 | unsigned long T1_; 34 | unsigned long T2_; 35 | bool Valid_; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /doc/examples/client-stateless.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: stateless autoconf 3 | # 4 | 5 | # this client configuration file is an example of how to configure 6 | # client in a stateless mode. Also all possible configuration 7 | # parameters are requested from the server. 8 | # Stateless means that client will not ask nor will receive any 9 | # addresses. 10 | 11 | log-level 8 12 | log-mode short 13 | 14 | iface eth0 15 | { 16 | # This tells the client to run in stateless mode (i.e. only request 17 | # options and not addresses or prefixes) 18 | stateless 19 | 20 | option dns-server 21 | option domain 22 | option ntp-server 23 | option time-zone 24 | option sip-server 25 | option sip-domain 26 | option nis-server 27 | option nis-domain 28 | option nis+-server 29 | option nis+-domain 30 | option vendor-spec 31 | option aftr 32 | } 33 | -------------------------------------------------------------------------------- /CfgMgr/HostID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef STATIONID_H_ 11 | #define STATIONID_H_ 12 | 13 | #include "SmartPtr.h" 14 | #include "IPv6Addr.h" 15 | #include "DUID.h" 16 | 17 | #include 18 | #include 19 | 20 | class THostID 21 | { 22 | friend std::ostream& operator<<(std::ostream& out, THostID& station); 23 | public: 24 | 25 | THostID(SPtr addr); 26 | THostID(SPtr duid); 27 | bool operator==(SPtr addr); 28 | bool operator==(SPtr duid); 29 | 30 | //THostID(const THostID& info); 31 | //~THostID(); 32 | private: 33 | bool isIDAddress; 34 | SPtr Addr; 35 | SPtr DUID; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgConfirm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TClntMsgConfirm; 12 | 13 | #ifndef CLNTMSGCONFIRM_H 14 | #define CLNTMSGCONFIRM_H 15 | #include "ClntMsg.h" 16 | #include "ClntIfaceMgr.h" 17 | #include "ClntCfgIface.h" 18 | #include "ClntCfgIA.h" 19 | 20 | class TClntMsgConfirm : public TClntMsg 21 | { 22 | public: 23 | TClntMsgConfirm(unsigned int iface, List(TAddrIA) iaLst); 24 | bool check(); 25 | void answer(SPtr Rep); 26 | void doDuties(); 27 | unsigned long getTimeout(); 28 | std::string getName() const; 29 | 30 | void addrsAccepted(); 31 | void addrsRejected(); 32 | ~TClntMsgConfirm(); 33 | 34 | }; 35 | #endif /* CLNTMSGCONFIRM_H */ 36 | -------------------------------------------------------------------------------- /RelMessages/RelMsg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TRelMsg; 12 | #ifndef RELMSG_H 13 | #define RELMSG_H 14 | 15 | #include "Msg.h" 16 | 17 | class TRelMsg : public TMsg 18 | { 19 | public: 20 | TRelMsg(int iface, SPtr addr, char* data, int dataLen); 21 | virtual bool check() = 0; 22 | void setDestination(int ifindex, SPtr dest); 23 | int getDestIface(); 24 | SPtr getDestAddr(); 25 | void decodeOpts(char * data, int dataLen); 26 | int getHopCount(); 27 | 28 | protected: 29 | int DestIface; 30 | SPtr DestAddr; 31 | 32 | int HopCount; // mormal messages =0, RELAY_FORW, RELAY_REPL = (0..32) 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /doc/examples/client-addrparams.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: address parameters 3 | # 4 | # Warning: This feature is non-standard and is not described by any standards 5 | # or drafts. There is an ongoing process to create and publish such draft, however. 6 | # 7 | 8 | log-mode short 9 | log-level 8 10 | 11 | experimental 12 | 13 | # Current Dibbler release adds obtained addresses with /64 prefix. Although 14 | # this violates spec (RFC3315), it is very useful as hosts in the network can 15 | # exchange data immediately. To restore previous behavior, uncomment this line: 16 | # strict-rfc-no-routing 17 | 18 | iface "eth0" 19 | { 20 | ia 21 | { 22 | // address-parameters contain information about prefix length, so client 23 | // will ask for it. If server supports it too, addr-params option will be 24 | // granted. 25 | addr-params 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgRelease.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TClntMsgRelease; 12 | #ifndef CLNTMSGRELEASE_H 13 | #define CLNTMSGRELEASE_H 14 | #include "ClntMsg.h" 15 | 16 | class TClntMsgRelease : public TClntMsg 17 | { 18 | public: 19 | /* TClntMsgRelease(int iface, SPtr addr=NULL); */ 20 | 21 | TClntMsgRelease(int iface, SPtr addr, 22 | List(TAddrIA) iaLst, 23 | SPtr ta, 24 | List(TAddrIA) pdLst); 25 | 26 | void answer(SPtr Rep); 27 | void doDuties(); 28 | bool check(); 29 | std::string getName() const; 30 | ~TClntMsgRelease(); 31 | }; 32 | #endif /* CLNTMSGRELEASE_H */ 33 | -------------------------------------------------------------------------------- /bison++/Example/MyScanner.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #ifndef FLEXFIX 3 | #define FLEXFIX YY_MyParser_STYPE *val 4 | #define FLEXFIX2 val 5 | #endif 6 | #include "MyParser.h" // Make sure the flexer can communicate with bison++ 7 | //using return values 8 | %} 9 | 10 | digit [0-9] 11 | integer [1-9]{digit}* 12 | ws [ \t\n]+ 13 | %% 14 | {ws} { /* no action */ } 15 | {integer} { val->num = atoi(yytext); return MyParser::INTEGER; } 16 | "AND" {return(MyParser::AND);} 17 | "OR" {return(MyParser::OR);} 18 | "NOT" {return(MyParser::NOT);} 19 | "TRUE" {val->statement=true; return MyParser::BOOLEAN; } 20 | "FALSE" {val->statement=false; return MyParser::BOOLEAN; } 21 | "-" {return(MyParser::MINUS);} 22 | "+" {return(MyParser::PLUS);} 23 | "(" {return(MyParser::LPARA);} 24 | ")" {return(MyParser::RPARA);} 25 | 26 | <> { yyterminate();} 27 | %% 28 | int yywrap() 29 | { 30 | return(1); 31 | } -------------------------------------------------------------------------------- /doc/examples/server-addrparams.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file: Address-parameters 3 | # 4 | # Warning: This feature is non-standard and is not described by any standards 5 | # or drafts. There is an ongoing process to create and publish such draft, however. 6 | # 7 | 8 | # Logging level range: 1(Emergency)-8(Debug) 9 | # 10 | log-level 8 11 | 12 | # allow experimental stuff (e.g. addr-params) 13 | experimental 14 | 15 | # Don't log full date 16 | log-mode short 17 | 18 | iface eth0 { 19 | 20 | t1 60 21 | t2 96 22 | prefered-lifetime 120 23 | valid-lifetime 180 24 | 25 | class { 26 | addr-params 80 // addresses will be assigned with /80 prefix 27 | pool 2001:db8:ff01:ff03::/80 28 | } 29 | 30 | # provide DNS server location to the clients 31 | option dns-server 2001:db8:ffff:ffff::53 32 | 33 | # provide their domain name 34 | option domain interop.example.com 35 | } 36 | -------------------------------------------------------------------------------- /tests/3.2-relay/relay2.conf: -------------------------------------------------------------------------------- 1 | log-level 8 2 | log-mode full 3 | 4 | # messages will be forwarded on this interface using multicast 5 | iface eth2 { 6 | server multicast yes // relay messages on this interface to ff05::1:3 7 | # server unicast 6000::10 // relay messages on this interface to this global address 8 | } 9 | 10 | 11 | # client can send messages to multicast 12 | # (or specific link-local addr) on this link 13 | iface eth0 { 14 | client multicast yes // bind ff02::1:2 15 | # client unicast 6010::1 // bind this address 16 | interface-id 6010 17 | } 18 | 19 | iface eth1 { 20 | client multicast yes // bind ff02::1:2 21 | # client unicast 6011::1 // bind this address 22 | interface-id 6011 23 | } 24 | 25 | iface eth3 { 26 | client multicast yes // bind ff02::1:2 27 | # client unicast 6020::1 // bind this address 28 | interface-id 6020 29 | } 30 | -------------------------------------------------------------------------------- /tests/LowLevel/test1.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "Portable.h" 4 | 5 | 6 | int main() { 7 | 8 | char dev[] = "eth0"; 9 | char prefix[] = "2000::"; 10 | int len = 64; 11 | int result; 12 | 13 | domain_add("eth0", 4, "example.com"); 14 | domain_add("eth0", 4, "klub.com.pl"); 15 | 16 | getwchar(); 17 | 18 | domain_del("eth0", 4, "example.com"); 19 | getwchar(); 20 | domain_del("eth0", 4, "klub.com.pl"); 21 | 22 | #if 0 23 | lowlevelInit(); 24 | 25 | printf("Adding %s/%d prefix to %s interface\n", prefix, len, dev); 26 | result = prefix_add(dev, 4, prefix, len); 27 | printf("RESULT=%d\n", result); 28 | 29 | getwchar(); 30 | 31 | result = printf("Deleting the same prefix\n"); 32 | prefix_del(dev, 4, prefix, len); 33 | printf("RESULT=%d\n", result); 34 | 35 | lowlevelExit(); 36 | #endif 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /Port-bsd/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * changes: Paul Schauer 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: daemon.h,v 1.3 2009-04-19 21:37:44 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef DAEMON_H 14 | #define DAEMON_H 15 | 16 | #ifndef SIGTERM 17 | #define SIGTERM 15 18 | #endif 19 | 20 | #ifndef SIGINT 21 | #define SIGINT 2 22 | #endif 23 | 24 | int start(const char * pidfile, const char * workdir); 25 | int stop(const char * pidfile); 26 | 27 | int init(const char * pidfile, const char * workdir); 28 | int getPID(char * pidfile); 29 | int getServerPID(); 30 | int getClientPID(); 31 | int getRelayPID(); 32 | int die(const char * pidfile); 33 | 34 | void logStart(const char * note, const char * logname, const char * logfile); 35 | void logEnd(); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Port-sun/daemon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * changes: Paul Schauer 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: daemon.h,v 1.3 2009-04-19 21:37:44 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef DAEMON_H 14 | #define DAEMON_H 15 | 16 | #ifndef SIGTERM 17 | #define SIGTERM 15 18 | #endif 19 | 20 | #ifndef SIGINT 21 | #define SIGINT 2 22 | #endif 23 | 24 | int start(const char * pidfile, const char * workdir); 25 | int stop(const char * pidfile); 26 | 27 | int init(const char * pidfile, const char * workdir); 28 | int getPID(char * pidfile); 29 | int getServerPID(); 30 | int getClientPID(); 31 | int getRelayPID(); 32 | int die(const char * pidfile); 33 | 34 | void logStart(const char * note, const char * logname, const char * logfile); 35 | void logEnd(); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /scripts/notify-scripts/server-notify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this is example notify script that can be invoked on a server side 4 | # This script will be called by dibbler-server with a single parameter 5 | # describing operation (add, update, delete, expire) 6 | # 7 | # Many parameters will be passed as environment variables 8 | 9 | LOGFILE=/var/lib/dibbler/server-notify.log 10 | 11 | echo "---$1--------" >> $LOGFILE 12 | date >> $LOGFILE 13 | 14 | # uncomment this to get full list of available variables 15 | #set >> $LOGFILE 16 | 17 | if [ "$ADDR1" != "" ]; then 18 | echo "Address ${ADDR1} (operation $1) to client $REMOTE_ADDR on inteface $IFACE/$IFINDEX" >> $LOGFILE 19 | fi 20 | 21 | if [ "$PREFIX1" != "" ]; then 22 | echo "Prefix ${PREFIX1} (operation $1) to client $REMOTE_ADDR on inteface $IFACE/$IFINDEX" >> $LOGFILE 23 | fi 24 | 25 | # sample return code. Dibbler will just print it out. 26 | exit 3 27 | -------------------------------------------------------------------------------- /Options/OptTA.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | class TOptTA; 11 | #ifndef OPTIA_TA_H 12 | #define OPTIA_TA_H 13 | 14 | #include "Opt.h" 15 | 16 | // length without optType and Length 17 | #define OPTION_IA_TA_LEN 4 18 | 19 | class TOptTA : public TOpt 20 | { 21 | public: 22 | TOptTA(uint32_t iaid, TMsg* parent); 23 | TOptTA(char * &buf, int &bufsize, TMsg* parent); 24 | size_t getSize(); 25 | int getStatusCode(); 26 | 27 | unsigned long getIAID(); 28 | unsigned long getMaxValid(); 29 | int countAddrs(); 30 | 31 | char * storeSelf( char* buf); 32 | virtual bool isValid() const; 33 | bool doDuties() { return true; } 34 | protected: 35 | uint32_t IAID_; 36 | bool Valid_; 37 | }; 38 | 39 | 40 | #endif /* OPTIA_TA_H */ 41 | -------------------------------------------------------------------------------- /SrvCfgMgr/NodeConstant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Nguyen Vinh Nghiem 5 | * changes: Tomasz Mrugalski 6 | * 7 | * released under GNU GPL v2 or later licence 8 | * 9 | */ 10 | 11 | #ifndef NODECONSTANT_CPP_ 12 | #define NODECONSTANT_CPP_ 13 | 14 | #include "NodeConstant.h" 15 | #include "SrvMsg.h" 16 | #include "SrvMsg.h" 17 | 18 | using namespace std; 19 | 20 | NodeConstant::NodeConstant() 21 | :Node(NODE_CONST) { 22 | } 23 | 24 | NodeConstant::~NodeConstant() { 25 | } 26 | 27 | NodeConstant::NodeConstant(std::string v) 28 | :Node(NODE_CONST), value(v) { 29 | } 30 | 31 | 32 | std::string NodeConstant::getStringValue() { 33 | return value; 34 | } 35 | 36 | std::string NodeConstant::exec() { 37 | return value; 38 | } 39 | 40 | string NodeConstant::exec(SPtr msg) { 41 | return value; 42 | } 43 | #endif /* NODECONSTANT_CPP_ */ 44 | -------------------------------------------------------------------------------- /Requestor/ReqTransMgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * Released under GNU GPL v2 licence 7 | * 8 | * $Id: ReqTransMgr.h,v 1.5 2008-01-01 20:21:14 thomson Exp $ 9 | */ 10 | 11 | #ifndef REQIFACEMGR_H 12 | #define REQIFACEMGR_H 13 | 14 | #include "IfaceMgr.h" 15 | #include "ReqCfgMgr.h" 16 | 17 | class ReqTransMgr { 18 | public: 19 | ReqTransMgr(TIfaceMgr * ifaceMgr); 20 | void SetParams(ReqCfgMgr * cfgMgr); 21 | bool BindSockets(); 22 | bool SendMsg(); 23 | bool WaitForRsp(); 24 | 25 | private: 26 | void PrintRsp(char * buf, int bufLen); 27 | bool ParseOpts(int msgType, int recurseLevel, char * buf, int bufLen); 28 | std::string BinToString(char * buf, int bufLen); 29 | TIfaceMgr * IfaceMgr; 30 | SPtr Iface; 31 | ReqCfgMgr * CfgMgr; 32 | SPtr Socket; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /doc/examples/client-autodetect.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example client configuration file: Autodetect 3 | # 4 | 5 | # This config file is commented out. 6 | # Dibbler-client will autodetect all up, running, IPv6-supporting, multicast 7 | # capable interfaces and will try to obtain one IPv6 address on each of them. 8 | 9 | # To manually specify, what parameter should be obtained, uncomment 10 | # appropriate sections below. To get full list of supported options, 11 | # see Dibbler User's Guide. 12 | 13 | #log-mode short 14 | 15 | # 7 = omit debug messages 16 | #log-level 7 17 | 18 | # Current Dibbler release adds obtained addresses with /64 prefix. Although 19 | # this violates spec (RFC3315), it is very useful as hosts in the network can 20 | # exchange data immediately. To restore previous behavior, uncomment this line: 21 | # strict-rfc-no-routing 22 | 23 | #iface "eth0" { 24 | # ia 25 | # option dns-server 26 | # option domain 27 | #} 28 | -------------------------------------------------------------------------------- /ClntMessages/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libClntMessages.a 2 | 3 | libClntMessages_a_CPPFLAGS = -I$(top_srcdir)/Misc -I$(top_srcdir)/Messages -I$(top_srcdir)/Options -I$(top_srcdir)/ClntOptions 4 | libClntMessages_a_CPPFLAGS += -I$(top_srcdir)/ClntIfaceMgr -I$(top_srcdir)/IfaceMgr -I$(top_srcdir)/ClntCfgMgr 5 | libClntMessages_a_CPPFLAGS += -I$(top_srcdir)/CfgMgr -I$(top_srcdir)/AddrMgr -I$(top_srcdir)/ClntAddrMgr 6 | libClntMessages_a_CPPFLAGS += -I$(top_srcdir)/ClntTransMgr -I$(top_srcdir)/poslib 7 | 8 | libClntMessages_a_SOURCES = ClntMsgAdvertise.cpp ClntMsgAdvertise.h ClntMsgConfirm.cpp ClntMsgConfirm.h ClntMsg.cpp ClntMsgDecline.cpp ClntMsgDecline.h ClntMsg.h ClntMsgInfRequest.cpp ClntMsgInfRequest.h ClntMsgRebind.cpp ClntMsgRebind.h ClntMsgRelease.cpp ClntMsgRelease.h ClntMsgRenew.cpp ClntMsgRenew.h ClntMsgReply.cpp ClntMsgReply.h ClntMsgRequest.cpp ClntMsgRequest.h ClntMsgSolicit.cpp ClntMsgSolicit.h ClntMsgReconfigure.cpp ClntMsgReconfigure.h 9 | -------------------------------------------------------------------------------- /tests/crypto/Digests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sha256.h" 3 | 4 | void printHash(char* digest) { 5 | int x=0; 6 | for (x=0;x<32;x++) { 7 | printf("%02x", digest[x]); 8 | } 9 | printf("\n"); 10 | } 11 | 12 | int main() { 13 | 14 | char * buf1 = "The quick brown fox jumps over the lazy dog"; 15 | char digest[32]; 16 | 17 | int len = strlen(buf1); 18 | void * result = sha256_buffer(buf1, len, (void*)digest); 19 | 20 | printf("str=[%s] len=%d result=%p digest=%p\n", buf1, strlen(buf1), result, digest); 21 | printHash(digest); 22 | 23 | printf("\n"); 24 | 25 | char * buf2="The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the lazy dog"; 26 | len = strlen(buf2); 27 | result = sha256_buffer(buf2, len, (void*)digest); 28 | 29 | printf("str=[%s] len=%d result=%p digest=%p\n", buf2, strlen(buf2), result, digest); 30 | printHash(digest); 31 | } 32 | -------------------------------------------------------------------------------- /Requestor/ReqOpt.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | * $Id: ReqOpt.cpp,v 1.3 2008-08-29 00:07:33 thomson Exp $ 9 | * 10 | */ 11 | #include "ReqOpt.h" 12 | 13 | TReqOptAddr::TReqOptAddr(int type, SPtr addr, TMsg * parent) 14 | :TOptIAAddress(addr, 0x33333333, 0x88888888, parent) 15 | { 16 | } 17 | 18 | bool TReqOptAddr::doDuties() 19 | { 20 | return true; 21 | } 22 | 23 | TReqOptDUID::TReqOptDUID(int type, SPtr duid, TMsg* parent) 24 | :TOptDUID(type, duid, parent) 25 | { 26 | } 27 | 28 | bool TReqOptDUID::doDuties() 29 | { 30 | return true; 31 | } 32 | 33 | TReqOptGeneric::TReqOptGeneric(int optType, char * data, int dataLen, TMsg* parent) 34 | :TOptGeneric(optType, data, dataLen, parent) 35 | { 36 | } 37 | 38 | bool TReqOptGeneric::doDuties() 39 | { 40 | return true; 41 | } 42 | -------------------------------------------------------------------------------- /poslib/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . 2 | 3 | if HAVE_GTEST 4 | SUBDIRS += tests 5 | endif 6 | 7 | noinst_LIBRARIES = libPoslib.a 8 | AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/nettle -I$(top_srcdir)/Misc 9 | 10 | libPoslib_a_SOURCES = \ 11 | dnsmessage.cpp \ 12 | domainfn.cpp \ 13 | dnssec-sign.cpp \ 14 | dnssec-sign.h \ 15 | exception.cpp \ 16 | lexfn.cpp \ 17 | masterfile.cpp \ 18 | postime.cpp \ 19 | random.cpp \ 20 | resolver.cpp \ 21 | rr.cpp \ 22 | socket.cpp \ 23 | vsnprintf.cpp \ 24 | bits.h \ 25 | dnsmessage.h \ 26 | dnsdefs.h \ 27 | domainfn.h \ 28 | exception.h \ 29 | lexfn.h \ 30 | masterfile.h \ 31 | poslib.h \ 32 | postime.h \ 33 | random.h \ 34 | resolver.h \ 35 | rr.h \ 36 | socket.h \ 37 | syssocket.h \ 38 | sysstl.h \ 39 | sysstring.h \ 40 | syssocket.h \ 41 | types.h \ 42 | vsnprintf.h 43 | 44 | 45 | dist_noinst_DATA = w32poll.cpp w32poll.h ChangeLog-poslib 46 | -------------------------------------------------------------------------------- /Options/OptIA_PD.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Krzysztof Wnuk 5 | * 6 | */ 7 | 8 | class TOptIA_PD; 9 | #ifndef OPTIA_PD_H 10 | #define OPTIA_PD_H 11 | 12 | #include 13 | #include "Opt.h" 14 | 15 | class TOptIA_PD : public TOpt 16 | { 17 | public: 18 | TOptIA_PD(uint32_t iaid, uint32_t t1, uint32_t t2, TMsg* parent); 19 | TOptIA_PD(char * &buf, int &bufsize, TMsg* parent); 20 | size_t getSize(); 21 | int getStatusCode(); 22 | 23 | uint32_t getIAID() const; 24 | uint32_t getT1() const; 25 | uint32_t getT2() const; 26 | int countPrefixes(); 27 | 28 | void setT1(uint32_t t1); 29 | void setT2(uint32_t t2); 30 | void setIAID(uint32_t iaid); 31 | 32 | char * storeSelf( char* buf); 33 | bool isValid() const; 34 | protected: 35 | uint32_t IAID_; 36 | uint32_t T1_; 37 | uint32_t T2_; 38 | bool Valid_; 39 | }; 40 | 41 | 42 | #endif /* */ 43 | -------------------------------------------------------------------------------- /Options/OptRtPrefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Mateusz Ozga 5 | * changes: Tomek Mrugalski 6 | * 7 | * Released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | #include "IPv6Addr.h" 12 | #include "SmartPtr.h" 13 | #include "Opt.h" 14 | 15 | class TOptRtPrefix : public TOpt 16 | { 17 | public: 18 | TOptRtPrefix(uint32_t lifetime, uint8_t prefixlen, uint8_t metric, SPtr prefix, TMsg* parent); 19 | TOptRtPrefix(const char * buf, int bufsize, TMsg* parent); 20 | char* storeSelf(char* buf); 21 | size_t getSize(); 22 | bool doDuties() { return true; }; 23 | 24 | uint32_t getLifetime(); 25 | uint8_t getPrefixLen(); 26 | uint8_t getMetric(); 27 | SPtr getPrefix(); 28 | std::string getPlain(); 29 | protected: 30 | uint32_t Lifetime; 31 | uint8_t PrefixLen; 32 | uint8_t Metric; 33 | SPtr Prefix; 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgConfirm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: SrvMsgConfirm.cpp,v 1.6 2008-08-29 00:07:34 thomson Exp $ 10 | * 11 | */ 12 | 13 | #include "SmartPtr.h" 14 | #include "AddrClient.h" 15 | #include "SrvMsgConfirm.h" 16 | 17 | TSrvMsgConfirm::TSrvMsgConfirm(int iface, SPtr addr, char* buf, int bufSize) 18 | :TSrvMsg(iface, addr,buf,bufSize) { 19 | } 20 | 21 | void TSrvMsgConfirm::doDuties() { 22 | } 23 | 24 | unsigned long TSrvMsgConfirm::getTimeout() { 25 | return 0; 26 | } 27 | 28 | bool TSrvMsgConfirm::check() { 29 | return TSrvMsg::check(true /* ClientID required */, false /* ServerID not allowed */); 30 | } 31 | 32 | TSrvMsgConfirm::~TSrvMsgConfirm() { 33 | } 34 | 35 | std::string TSrvMsgConfirm::getName() const { 36 | return "CONFIRM"; 37 | } 38 | -------------------------------------------------------------------------------- /Options/OptAddrLst.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #ifndef OPTDNSSERVERS_H 11 | #define OPTDNSSERVERS_H 12 | #include "IPv6Addr.h" 13 | #include "Container.h" 14 | #include "SmartPtr.h" 15 | #include "Opt.h" 16 | 17 | class TOptAddrLst : public TOpt 18 | { 19 | public: 20 | TOptAddrLst(int type, List(TIPv6Addr) lst, TMsg* parent); 21 | TOptAddrLst(int type, const char *buf, unsigned short len, TMsg* parent); 22 | char * storeSelf( char* buf); 23 | size_t getSize(); 24 | void firstAddr(); 25 | SPtr getAddr(); 26 | const List(TIPv6Addr)& getAddrLst() { return AddrLst; } 27 | int countAddr(); 28 | bool isValid() const; 29 | virtual bool doDuties() { return true; } // does nothing on its own 30 | std::string getPlain(); 31 | protected: 32 | List(TIPv6Addr) AddrLst; 33 | }; 34 | #endif 35 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgRebind.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: SrvMsgRebind.cpp,v 1.6 2008-08-29 00:07:35 thomson Exp $ 10 | * 11 | */ 12 | #include "SmartPtr.h" 13 | #include "SrvMsg.h" 14 | #include "SrvMsgRebind.h" 15 | #include "AddrClient.h" 16 | 17 | TSrvMsgRebind::TSrvMsgRebind(int iface, SPtr addr, char* buf, int bufSize) 18 | :TSrvMsg(iface, addr,buf,bufSize) { 19 | } 20 | 21 | void TSrvMsgRebind::doDuties() { 22 | } 23 | 24 | unsigned long TSrvMsgRebind::getTimeout() { 25 | return 0; 26 | } 27 | 28 | bool TSrvMsgRebind::check() { 29 | return TSrvMsg::check(true /* ClientID required */, false /* ServerID not allowed */); 30 | } 31 | 32 | std::string TSrvMsgRebind::getName() const { 33 | return "REBIND"; 34 | } 35 | 36 | TSrvMsgRebind::~TSrvMsgRebind() { 37 | } 38 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgAdvertise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntMsgAdvertise.h,v 1.6 2008-08-29 00:07:28 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef SRVMSGADVERTISE_H 14 | #define SRVMSGADVERTISE_H 15 | 16 | #include "ClntMsg.h" 17 | 18 | class TClntMsgAdvertise : public TClntMsg 19 | { 20 | public: 21 | /* TClntMsgAdvertise(int iface, SPtr addr); */ 22 | 23 | TClntMsgAdvertise(int iface, SPtr addr, 24 | char* buf, int bufSize); 25 | 26 | // returns preference value (default value is 0) 27 | int getPreference(); 28 | bool check(); 29 | void answer(SPtr Rep); 30 | void doDuties(); 31 | std::string getName() const; 32 | std::string getInfo(); 33 | ~TClntMsgAdvertise(); 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ClntOptions/ClntOptTimeZone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntOptTimeZone.h,v 1.4 2008-08-29 00:07:29 thomson Exp $ 10 | * 11 | * $Log: not supported by cvs2svn $ 12 | * Revision 1.3 2004-10-25 20:45:53 thomson 13 | * Option support, parsers rewritten. ClntIfaceMgr now handles options. 14 | * 15 | * 16 | */ 17 | 18 | #ifndef CLNTOPTTIMEZONE_H 19 | #define CLNTOPTTIMEZONE_H 20 | 21 | #include "OptString.h" 22 | #include "DUID.h" 23 | 24 | class TClntOptTimeZone : public TOptString 25 | { 26 | public: 27 | TClntOptTimeZone(const std::string& domain, TMsg* parent); 28 | TClntOptTimeZone(char *buf, int bufsize, TMsg* parent); 29 | bool doDuties(); 30 | void setSrvDuid(SPtr duid); 31 | bool isValid() const; 32 | private: 33 | SPtr SrvDUID; 34 | }; 35 | #endif 36 | -------------------------------------------------------------------------------- /doc/examples/server-leasequery.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file 3 | # 4 | # This config. file is considered all-purpose as it instructs server 5 | # to provide almost every configuratio 6 | # 7 | 8 | # Logging level range: 1(Emergency)-8(Debug) 9 | log-level 8 10 | 11 | # Don't log full date 12 | log-mode short 13 | 14 | # set preference of this server to 0 (higher = more prefered) 15 | preference 0 16 | 17 | iface "eth0" { 18 | accept-leasequery 19 | 20 | // also ranges can be defines, instead of exact values 21 | t1 1800-2000 22 | t2 2700-3000 23 | prefered-lifetime 3600 24 | valid-lifetime 7200 25 | 26 | # assign addresses from this pool 27 | class { 28 | pool 2001:db8:1111::/64 29 | } 30 | 31 | # assign temporary addresses from this pool 32 | 33 | ta-class { 34 | pool 2001:db8:2222::/96 35 | } 36 | 37 | #assign /96 prefixes from this pool 38 | pd-class { 39 | pd-pool 2001:db8:3333:ff03:abcd::/80 40 | pd-length 96 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Options/OptInteger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | #ifndef OPTINTEGER4_H 12 | #define OPTINTEGER4_H 13 | #include 14 | #include 15 | 16 | #include "Opt.h" 17 | 18 | class TOptInteger : public TOpt 19 | { 20 | public: 21 | TOptInteger(uint16_t type, unsigned int len/* 1,2, or 4*/, unsigned int value, TMsg* parent); 22 | TOptInteger(uint16_t type, unsigned int len/* 1,2, or 4*/, const char *buf, size_t size, TMsg* parent); 23 | char * storeSelf( char* buf); 24 | size_t getSize(); 25 | unsigned int getValue(); 26 | bool isValid() const; 27 | std::string getPlain(); 28 | bool doDuties() { return true; } 29 | protected: 30 | unsigned int Value; 31 | bool Valid; 32 | int Len; /* length in bytes of the integer field: 0-4 */ 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Requestor/ReqOpt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | * $Id: ReqOpt.h,v 1.3 2008-08-29 00:07:33 thomson Exp $ 9 | * 10 | */ 11 | 12 | #ifndef REQOPT_H 13 | #define REQOPT_H 14 | 15 | #include "Opt.h" 16 | #include "OptIAAddress.h" 17 | #include "OptDUID.h" 18 | #include "OptGeneric.h" 19 | 20 | class TReqOptAddr : public TOptIAAddress 21 | { 22 | public: 23 | TReqOptAddr(int type, SPtr addr, TMsg * parent); 24 | protected: 25 | bool doDuties(); 26 | }; 27 | 28 | class TReqOptDUID : public TOptDUID 29 | { 30 | public: 31 | TReqOptDUID(int type, SPtr duid, TMsg* parent); 32 | protected: 33 | bool doDuties(); 34 | }; 35 | 36 | class TReqOptGeneric : public TOptGeneric 37 | { 38 | public: 39 | TReqOptGeneric(int optType, char * data, int dataLen, TMsg* parent); 40 | protected: 41 | bool doDuties(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /doc/examples/server-stateless.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example server configuration file: stateless autoconf 3 | # 4 | # Stateless autoconf is used when clients does not ask for addresses or 5 | # prefixes. Note that in stateless mode, limited number of messages 6 | # is accepted: inf-request and relay-forw only. 7 | 8 | log-level 8 9 | log-mode short 10 | stateless 11 | 12 | iface eth0 { 13 | option dns-server 2000::100,2000::101 14 | option domain example.com, test1.example.com 15 | option ntp-server 2000::200,2000::201,2000::202 16 | option time-zone CET 17 | option sip-server 2000::300,2000::302,2000::303,2000::304 18 | option sip-domain sip1.example.com,sip2.example.com 19 | option nis-server 2000::400,2000::401,2000::404,2000::405,2000::405 20 | option nis-domain nis.example.com 21 | option nis+-server 2000::501,2000::502 22 | option nis+-domain nisplus.example.com 23 | option aftr cgn.example.com 24 | 25 | # renew obtained paramters every 1800 seconds 26 | option lifetime 1800 27 | } 28 | -------------------------------------------------------------------------------- /IfaceMgr/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir) 2 | AM_CPPFLAGS += -I$(top_srcdir)/IfaceMgr 3 | AM_CPPFLAGS += -I$(top_srcdir)/Misc 4 | AM_CPPFLAGS += -I$(top_srcdir)/poslib 5 | AM_CPPFLAGS += -I$(top_srcdir)/nettle 6 | 7 | # This is to workaround long long in gtest.h 8 | AM_CPPFLAGS += $(GTEST_INCLUDES) -Wno-long-long -Wno-variadic-macros 9 | 10 | TESTS = 11 | if HAVE_GTEST 12 | TESTS += DnsUpdate_tests 13 | 14 | DnsUpdate_tests_SOURCES = run_tests.cc 15 | DnsUpdate_tests_SOURCES += DnsUpdate_unittest.cc 16 | 17 | DnsUpdate_tests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) 18 | 19 | DnsUpdate_tests_LDADD = $(GTEST_LDADD) 20 | DnsUpdate_tests_LDADD += $(top_builddir)/IfaceMgr/libIfaceMgr.a 21 | DnsUpdate_tests_LDADD += $(top_builddir)/Misc/libMisc.a 22 | DnsUpdate_tests_LDADD += $(top_builddir)/poslib/libPoslib.a 23 | DnsUpdate_tests_LDADD += $(top_builddir)/nettle/libNettle.a 24 | DnsUpdate_tests_LDADD += $(top_builddir)/tests/utils/libTestUtils.a 25 | endif 26 | 27 | noinst_PROGRAMS = $(TESTS) 28 | -------------------------------------------------------------------------------- /Misc/ScriptParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #ifndef NOTIFYSCRIPTPARAMS 11 | #define NOTIFYSCRIPTPARAMS 12 | 13 | #include 14 | #include "IPv6Addr.h" 15 | 16 | class TNotifyScriptParams { 17 | public: 18 | static const int MAX_PARAMS = 512; 19 | const char * env[MAX_PARAMS]; 20 | std::string params; 21 | int envCnt; 22 | int ipCnt; 23 | int pdCnt; 24 | TNotifyScriptParams(); 25 | ~TNotifyScriptParams(); 26 | void addParam(const std::string& name, const std::string& value); 27 | void addAddr(SPtr addr, unsigned int prefered, unsigned int valid, 28 | std::string txt = std::string("") ); 29 | void addPrefix(SPtr prefix, unsigned short length, unsigned int prefered, 30 | unsigned int valid, std::string txt = std::string("")); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Options/OptDomainLst.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 licence 8 | */ 9 | 10 | #ifndef OPTSTRINGLST_H 11 | #define OPTSTRINGLST_H 12 | #include "Opt.h" 13 | #include 14 | #include 15 | 16 | class TOptDomainLst : public TOpt 17 | { 18 | public: 19 | TOptDomainLst(int type, List(std::string) strLst, TMsg* parent); 20 | TOptDomainLst(int type, const std::string& domain, TMsg* parent); 21 | TOptDomainLst(int type, const char *buf, unsigned short bufsize, TMsg* parent); 22 | const List(std::string)& getDomainLst() { return StringLst; } 23 | const std::string& getDomain(); 24 | char * storeSelf( char* buf); 25 | size_t getSize(); 26 | int countString(); 27 | bool doDuties() { return true; } 28 | virtual std::string getPlain(); 29 | protected: 30 | List(std::string) StringLst; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /AddrMgr/AddrPrefix.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Krzysztof Wnuk 5 | * 6 | * released under GNU GPL v2 licence 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "Portable.h" 14 | #include "AddrPrefix.h" 15 | #include "DHCPConst.h" 16 | #include "Logger.h" 17 | 18 | using namespace std; 19 | 20 | TAddrPrefix::TAddrPrefix(SPtr prefix, long pref, long valid, int length) 21 | :TAddrAddr(prefix, pref, valid) 22 | { 23 | this->Length = length; 24 | } 25 | 26 | int TAddrPrefix::getLength() { 27 | return this->Length; 28 | } 29 | 30 | ostream & operator<<(ostream & strum,TAddrPrefix &x) { 31 | strum << "" << x.Addr->getPlain()<< "" << std::endl; 38 | return strum; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Options/OptGeneric.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 licence 7 | * 8 | * $Id: OptGeneric.h,v 1.3 2008-11-11 22:41:48 thomson Exp $ 9 | * 10 | */ 11 | 12 | #ifndef OPTGENERIC_H 13 | #define OPTGENERIC_H 14 | 15 | #include "DHCPConst.h" 16 | #include "Opt.h" 17 | #include "DUID.h" 18 | #include "SmartPtr.h" 19 | 20 | class TOptGeneric : public TOpt 21 | { 22 | public: 23 | bool operator == (const TOptGeneric &other); 24 | 25 | TOptGeneric(int optType, const char * data, unsigned short dataLen, TMsg* parent); 26 | TOptGeneric(int optType, TMsg* parent); 27 | ~TOptGeneric(); 28 | size_t getSize(); 29 | void setData(char * data, int dataLen); 30 | std::string getPlain(); 31 | bool doDuties() { return true; } 32 | 33 | char * storeSelf(char* buf); 34 | virtual bool isValid() const; 35 | protected: 36 | char * Data; 37 | int DataLen; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgInfRequest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | #include "SrvMsgInfRequest.h" 12 | #include "SmartPtr.h" 13 | #include "DHCPConst.h" 14 | #include "SrvMsgAdvertise.h" 15 | 16 | TSrvMsgInfRequest::TSrvMsgInfRequest(int iface, SPtr addr, char* buf, int bufSize) 17 | :TSrvMsg(iface, addr, buf, bufSize) { 18 | } 19 | 20 | void TSrvMsgInfRequest::doDuties() { 21 | return; 22 | } 23 | 24 | bool TSrvMsgInfRequest::check() { 25 | /* client is not required (but is allowed) to include ClientID option, also ServerID is optional */ 26 | return true; 27 | } 28 | 29 | unsigned long TSrvMsgInfRequest::getTimeout() { 30 | return 0; 31 | } 32 | 33 | std::string TSrvMsgInfRequest::getName() const { 34 | return "INF-REQUEST"; 35 | } 36 | 37 | 38 | TSrvMsgInfRequest::~TSrvMsgInfRequest(){ 39 | } 40 | -------------------------------------------------------------------------------- /bison++/system.h: -------------------------------------------------------------------------------- 1 | #ifdef MSDOS 2 | #ifndef _MSDOS 3 | #define _MSDOS 4 | #endif 5 | #endif 6 | 7 | #if defined(HAVE_STDLIB_H) || defined(_MSDOS) 8 | #include 9 | #endif 10 | 11 | #if (defined(VMS) || defined(MSDOS)) && !defined(HAVE_STRING_H) 12 | #define HAVE_STRING_H 1 13 | #endif 14 | 15 | #ifdef _MSDOS 16 | #include 17 | 18 | #define strlwr _strlwr 19 | #define strupr _strupr 20 | #define unlink _unlink 21 | #define mktemp _mktemp 22 | #endif /* MSDOS */ 23 | 24 | #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) 25 | #include 26 | /* An ANSI string.h and pre-ANSI memory.h might conflict. */ 27 | #if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) 28 | #include 29 | #endif /* not STDC_HEADERS and HAVE_MEMORY_H */ 30 | #define bcopy(src, dst, num) memcpy((dst), (src), (num)) 31 | #else /* not STDC_HEADERS and not HAVE_STRING_H */ 32 | #include 33 | /* memory.h and strings.h conflict on some systems. */ 34 | #endif /* not STDC_HEADERS and not HAVE_STRING_H */ 35 | -------------------------------------------------------------------------------- /Options/OptVendorClass.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 licence 7 | * 8 | */ 9 | 10 | #include "DHCPConst.h" 11 | #include "OptVendorClass.h" 12 | #include "Portable.h" 13 | #include 14 | 15 | TOptVendorClass::TOptVendorClass(uint16_t type, const char* buf, unsigned short buf_len, TMsg* parent) 16 | :TOptUserClass(type, parent) { 17 | if (buf_len < 4) { 18 | Valid = false; 19 | return; 20 | } 21 | Enterprise_id_ = readUint32(buf); 22 | buf += sizeof(uint32_t); 23 | buf_len -= sizeof(uint32_t); 24 | Valid = parseUserData(buf, buf_len); 25 | } 26 | 27 | size_t TOptVendorClass::getSize() { 28 | return 4 + TOptUserClass::getSize(); 29 | } 30 | 31 | char * TOptVendorClass::storeSelf(char* buf) { 32 | buf = writeUint16(buf, OptType); 33 | buf = writeUint16(buf, getSize() - 4); 34 | buf = writeUint32(buf, Enterprise_id_); 35 | return storeUserData(buf); 36 | } 37 | -------------------------------------------------------------------------------- /Options/OptUserClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | */ 9 | 10 | #ifndef OPTUSERCLASS_H 11 | #define OPTUSERCLASS_H 12 | 13 | #include "Opt.h" 14 | #include 15 | #include 16 | 17 | class TOptUserClass : public TOpt 18 | { 19 | public: 20 | struct UserClassData { 21 | std::vector opaqueData_; 22 | }; 23 | 24 | std::vector userClassData_; 25 | 26 | bool parseUserData(const char* buf, unsigned short buf_len); 27 | 28 | TOptUserClass(uint16_t type, const char* buf, unsigned short buf_len, TMsg* parent); 29 | TOptUserClass(uint16_t type, TMsg* parent); 30 | size_t getSize(); 31 | virtual bool isValid() const; 32 | char* storeSelf( char* buf); 33 | bool doDuties() { return false; } 34 | protected: 35 | char* storeUserData(char* buf); 36 | }; 37 | 38 | #endif /* USERCLASS_H */ 39 | -------------------------------------------------------------------------------- /poslib/examples/host.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char **argv) { 5 | _addr addr; 6 | DnsMessage *q = NULL, *a = NULL; 7 | pos_cliresolver res; 8 | a_record ip; 9 | 10 | try { 11 | /* get command-line arguments */ 12 | if (argc == 3 && argv[1][0] == '@') { 13 | txt_to_addr(&addr, argv[1] + 1); 14 | q = create_query(argv[2]); 15 | } else if (argc == 2) { 16 | txt_to_addr(&addr, "127.0.0.1"); 17 | q = create_query(argv[1]); 18 | } else { 19 | printf("Usage: host [@if] host\n"); 20 | return 1; 21 | } 22 | 23 | res.query(q, a, &addr); 24 | ip = get_a_record(a); 25 | printf("%s has address %d.%d.%d.%d\n", q->questions.begin()->QNAME.tocstr(), ip.address[0], ip.address[1], ip.address[2], ip.address[3]); 26 | 27 | } catch (PException p) { 28 | printf("Fatal exception: %s\n", p.message); 29 | return 1; 30 | } 31 | 32 | if (q) delete q; 33 | if (a) delete a; 34 | 35 | return 0; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /bison++/configure.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Configuring bison for go32 3 | rem This batch file assumes a unix-type "sed" program 4 | 5 | echo # Makefile generated by "configure.bat"> Makefile 6 | echo all.dos : bison >> Makefile 7 | 8 | if exist config.sed del config.sed 9 | 10 | echo "s/@srcdir@/./g ">> config.sed 11 | echo "s/@CC@/gcc/g ">> config.sed 12 | echo "s/@INSTALL@//g ">> config.sed 13 | echo "s/@INSTALL_PROGRAM@//g ">> config.sed 14 | echo "s/@INSTALL_DATA@//g ">> config.sed 15 | echo "s/@DEFS@/-DHAVE_STRERROR/g ">> config.sed 16 | echo "s/@LIBS@//g ">> config.sed 17 | echo "s/@ALLOCA@//g ">> config.sed 18 | 19 | echo "/^bison[ ]*:/,/-o/ { ">> config.sed 20 | echo " s/ \$(CC)/ >bison.rf/ ">> config.sed 21 | echo " /-o/ a\ ">> config.sed 22 | echo " $(CC) @bison.rf ">> config.sed 23 | echo "} ">> config.sed 24 | 25 | sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed 26 | sed -f config2.sed Makefile.in >> Makefile 27 | del config.sed 28 | del config2.sed 29 | -------------------------------------------------------------------------------- /Misc/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . 2 | 3 | if HAVE_GTEST 4 | SUBDIRS += tests 5 | endif 6 | 7 | noinst_LIBRARIES = libMisc.a 8 | 9 | libMisc_a_CFLAGS = -std=c99 10 | 11 | libMisc_a_CPPFLAGS = -I$(top_srcdir) 12 | 13 | libMisc_a_SOURCES = addrpack.c 14 | libMisc_a_SOURCES += base64.c base64.h 15 | libMisc_a_SOURCES += SmartPtr.h Container.h 16 | libMisc_a_SOURCES += hex.cpp hex.h 17 | libMisc_a_SOURCES += DHCPConst.cpp DHCPConst.h DHCPDefaults.h 18 | libMisc_a_SOURCES += DUID.cpp DUID.h 19 | libMisc_a_SOURCES += FQDN.cpp FQDN.h 20 | libMisc_a_SOURCES += IPv6Addr.cpp IPv6Addr.h 21 | libMisc_a_SOURCES += KeyList.cpp KeyList.h Key.cpp Key.h 22 | libMisc_a_SOURCES += Logger.cpp Logger.h 23 | libMisc_a_SOURCES += long128.cpp long128.h 24 | libMisc_a_SOURCES += Portable.h 25 | libMisc_a_SOURCES += ScriptParams.cpp ScriptParams.h 26 | libMisc_a_SOURCES += lowlevel-posix.c 27 | 28 | libMisc_a_SOURCES += hmac-sha-md5.h hmac-sha-md5.c 29 | libMisc_a_SOURCES += md5-coreutils.c md5.h 30 | libMisc_a_SOURCES += sha1.c sha1.h sha256.c sha256.h sha512.c sha512.h -------------------------------------------------------------------------------- /ClntOptions/ClntOptFQDN.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Krzysztof Wnuk 5 | * 6 | * $Id: ClntOptFQDN.h,v 1.3 2006-10-06 00:42:13 thomson Exp $ 7 | * 8 | * $Log: not supported by cvs2svn $ 9 | * Revision 1.2 2006-03-02 00:59:22 thomson 10 | * ClntOptFQDN implemented for real. 11 | * 12 | * Revision 1.1 2004/10/25 20:45:53 thomson 13 | * Option support, parsers rewritten. ClntIfaceMgr now handles options. 14 | * 15 | * 16 | */ 17 | 18 | #ifndef CLNTOPTFQDN_H 19 | #define CLNTOPTFQDN_H 20 | 21 | #include "OptFQDN.h" 22 | #include "DUID.h" 23 | #include "SmartPtr.h" 24 | #include "ClntIfaceMgr.h" 25 | 26 | 27 | // void *updateDNS(void *IfaceMgr); 28 | 29 | class TClntOptFQDN : public TOptFQDN 30 | { 31 | public: 32 | TClntOptFQDN(const std::string& fqdn, TMsg* parent); 33 | TClntOptFQDN(char *buf, int bufsize, TMsg* parent); 34 | bool doDuties(); 35 | void setSrvDuid(SPtr duid); 36 | private: 37 | SPtr SrvDUID; 38 | }; 39 | 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /bison++/types.h: -------------------------------------------------------------------------------- 1 | /* Define data type for representing bison's grammar input as it is parsed, 2 | Copyright (C) 1984, 1989 Free Software Foundation, Inc. 3 | 4 | This file is part of Bison, the GNU Compiler Compiler. 5 | 6 | Bison is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2, or (at your option) 9 | any later version. 10 | 11 | Bison is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Bison; see the file COPYING. If not, write to 18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 19 | 20 | 21 | typedef 22 | struct shorts 23 | { 24 | struct shorts *next; 25 | short value; 26 | } 27 | shorts; 28 | -------------------------------------------------------------------------------- /Misc/DUID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * Released under GNU GPL v2 licence 8 | * 9 | */ 10 | 11 | class TDUID; 12 | #ifndef DUID_H_ 13 | #define DUID_H_ 14 | #include 15 | #include 16 | #include 17 | 18 | class TDUID 19 | { 20 | friend std::ostream& operator<<(std::ostream& out,TDUID &range); 21 | public: 22 | TDUID(); // @todo: remove this 23 | TDUID(const char* DUID,int DUIDlen); // packed 24 | TDUID(const char* text); // plain 25 | TDUID(const TDUID &duid); 26 | TDUID& operator=(const TDUID& duid); 27 | bool operator==(const TDUID &duid); 28 | bool operator<=(const TDUID &duid); 29 | size_t getLen() const; 30 | char * storeSelf(char* buf); 31 | const std::string getPlain() const; 32 | const char * get() const; 33 | 34 | ~TDUID(); 35 | 36 | private: 37 | std::vector DUID_; 38 | std::string Plain_; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgLeaseQuery.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | class TSrvMsgLeaseQuery; 11 | #ifndef SRVMSGLEASEQUERY_H 12 | #define SRVMSGLEASEQUERY_H 13 | 14 | #include "SmartPtr.h" 15 | #include "SrvMsg.h" 16 | #include "IPv6Addr.h" 17 | 18 | class TSrvMsgLeaseQuery : public TSrvMsg 19 | { 20 | public: 21 | TSrvMsgLeaseQuery(int iface, SPtr addr, char* buf, int bufSize); 22 | 23 | void doDuties(); 24 | bool check(); 25 | ~TSrvMsgLeaseQuery(); 26 | std::string getName() const; 27 | 28 | private: 29 | }; 30 | 31 | 32 | #endif /* SRVMSGREQUEST_H */ 33 | -------------------------------------------------------------------------------- /Misc/FQDN.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * author: Krzysztof Wnuk 5 | * 6 | * released under GNU GPL v2 only licence 7 | * 8 | */ 9 | 10 | #ifndef FQDN_H 11 | #define FQDN_H 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include "DUID.h" 18 | #include "IPv6Addr.h" 19 | #include "SmartPtr.h" 20 | 21 | class TFQDN 22 | { 23 | friend std::ostream& operator<<(std::ostream& out,TFQDN& truc); 24 | public: 25 | TFQDN(); //Creates any addresses and names 26 | TFQDN(SPtr duid, const std::string& name, bool used); 27 | TFQDN(SPtr addr, const std::string& name, bool used); 28 | TFQDN(const std::string& name, bool used); 29 | SPtr getDuid(); 30 | SPtr getAddr(); 31 | std::string getName(); 32 | bool isUsed(); 33 | void setUsed(bool used); 34 | 35 | private: 36 | SPtr Duid_; 37 | SPtr Addr_; 38 | std::string Name_; 39 | bool Used_; 40 | }; 41 | #endif 42 | -------------------------------------------------------------------------------- /SrvMessages/SrvMsgConfirm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: SrvMsgConfirm.h,v 1.5 2008-08-29 00:07:34 thomson Exp $ 10 | * 11 | */ 12 | 13 | #ifndef SRVMSGCONFIRM_H 14 | #define SRVMSGCONFIRM_H 15 | #include "SrvMsg.h" 16 | #include "SrvIfaceMgr.h" 17 | #include "SrvTransMgr.h" 18 | #include "SrvCfgMgr.h" 19 | #include "SrvAddrMgr.h" 20 | 21 | // Client sends CONFIRM to a server to verify that his addresses 22 | // are still valid. It could happen when: 23 | // 1. client has restated 24 | // 2. client changed link 25 | class TSrvMsgConfirm : public TSrvMsg 26 | { 27 | public: 28 | TSrvMsgConfirm(int iface, SPtr addr, char* buf, int bufSize); 29 | void doDuties(); 30 | bool check(); 31 | unsigned long getTimeout(); /// @todo this is obsolete 32 | ~TSrvMsgConfirm(); 33 | std::string getName() const; 34 | 35 | }; 36 | #endif /* SRVMSGCONFIRM_H*/ 37 | -------------------------------------------------------------------------------- /ClntCfgMgr/ClntCfgAddr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TClntCfgAddr; 12 | #ifndef CLNTCFGADDR_H 13 | #define CLNTCFGADDR_H 14 | 15 | #include "DHCPConst.h" 16 | #include "ClntParsGlobalOpt.h" 17 | #include "SmartPtr.h" 18 | #include "IPv6Addr.h" 19 | #include 20 | #include 21 | 22 | 23 | class TClntCfgAddr 24 | { 25 | friend std::ostream& operator<<(std::ostream& out, TClntCfgAddr& group); 26 | public: 27 | TClntCfgAddr(); 28 | TClntCfgAddr(SPtr addr); 29 | TClntCfgAddr(SPtr addr,long valid,long pref); 30 | ~TClntCfgAddr(); 31 | 32 | SPtr get(); 33 | unsigned long getValid(); 34 | unsigned long getPref(); 35 | void setOptions(SPtr opt); 36 | private: 37 | SPtr Addr; 38 | unsigned long Valid; 39 | unsigned long Pref; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /doc/examples/server-3classes.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Example relay configuration file: 3 classes 3 | # 4 | 5 | # This config file shows how to configure multiple classes on one interface. 6 | # Note the 'share' parameter which defines, how prefered is each class. 7 | # For example: 8 | # share = 100 for class 1, 9 | # share = 200 for class 2, 10 | # share = 300 for class 3 11 | # would mean, that: 12 | # class 1 provides 100/(100+200+300) = 16% of all requests 13 | # class 2 provides 200/(100+200+300) = 33% of all requests 14 | # class 3 provides 300/(100+200+300) = 50% of all requests 15 | 16 | log-level 7 17 | log-mode short 18 | 19 | iface eth0 { 20 | T1 1000 21 | T2 2000 22 | 23 | class { 24 | share 100 25 | pool 2001:db8:1::1-2001:db8:1::ff 26 | } 27 | class { 28 | share 200 29 | pool 2001:db8:2::/64 30 | } 31 | 32 | class { 33 | share 300 34 | pool 2001:db8:1::1234:5678/112 35 | } 36 | 37 | option dns-server 2001:db8::100,2001:db8::101 38 | option domain example.com, test1.example.com 39 | option sip-domain sip1.test.intra, sip2.test.intra 40 | } 41 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgRebind.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntMsgRebind.h,v 1.5 2008-08-29 00:07:28 thomson Exp $ 10 | * 11 | */ 12 | 13 | class TClntMsgRebind; 14 | #ifndef CLNTMSGREBIND_H 15 | #define CLNTMSGREBIND_H 16 | 17 | #include "ClntMsg.h" 18 | #include "ClntOptIA_NA.h" 19 | #include "OptDUID.h" 20 | #include "OptAddr.h" 21 | 22 | class TClntMsgRebind : public TClntMsg 23 | { 24 | public: 25 | TClntMsgRebind(TOptList ptrOpts, int iface); 26 | 27 | void answer(SPtr Rep); 28 | void doDuties(); 29 | bool check(); 30 | std::string getName() const; 31 | ~TClntMsgRebind(); 32 | private: 33 | void updateIA(SPtr ptrOptIA, 34 | SPtr optSrvDUID, 35 | SPtr optUnicast); 36 | void releaseIA(int IAID); 37 | void releasePD(int IAID); 38 | 39 | 40 | }; 41 | 42 | #endif /* REBIND_H_HEADER_INCLUDED_C1126D16 */ 43 | -------------------------------------------------------------------------------- /ClntMessages/ClntMsgRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * changes: Krzysztof Wnuk 7 | * released under GNU GPL v2 only licence 8 | * 9 | */ 10 | 11 | class TClntIfaceMgr; 12 | #ifndef CLNTMSGREQUEST_H 13 | #define CLNTMSGREQUEST_H 14 | 15 | #include "SmartPtr.h" 16 | #include "ClntMsg.h" 17 | 18 | class TClntMsgRequest : public TClntMsg 19 | { 20 | public: 21 | TClntMsgRequest(TOptList opts, int iface); 22 | TClntMsgRequest(List(TAddrIA) requestIALst, 23 | SPtr srvDUID, 24 | int iface); 25 | 26 | void answer(SPtr msg); 27 | void doDuties(); 28 | bool check(); 29 | std::string getName() const; 30 | ~TClntMsgRequest(); 31 | private: 32 | void setState(TOptList opts, EState state); 33 | void copyAddrsFromAdvertise(SPtr adv); 34 | void copyPrefixesFromAdvertise(SPtr adv); 35 | }; 36 | 37 | #endif /* CLNTMSGREQUEST_H */ 38 | -------------------------------------------------------------------------------- /Options/OptVendorData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 only licence 7 | */ 8 | 9 | #ifndef OPTVENDORDATA_H 10 | #define OPTVENDORDATA_H 11 | 12 | #include "Opt.h" 13 | //#include "DHCPConst.h" 14 | 15 | class TOptVendorData : public TOpt 16 | { 17 | public: 18 | TOptVendorData(int type, int enterprise, char * data, int dataLen, TMsg* parent); 19 | TOptVendorData(int type, const char * buf, int n, TMsg* parent); 20 | size_t getSize(); 21 | char * storeSelf( char* buf); 22 | virtual bool isValid() const; 23 | 24 | /// @todo: should return uint32_t 25 | int getVendor(); 26 | char * getVendorData(); // returns vendor data (binary) 27 | std::string getVendorDataPlain(); // returns vendor data (as a printable string) 28 | int getVendorDataLen(); // returns vendor data length 29 | bool doDuties() { return true; } 30 | 31 | protected: 32 | int Vendor; 33 | char * VendorData; 34 | int VendorDataLen; 35 | }; 36 | #endif 37 | -------------------------------------------------------------------------------- /Requestor/ReqMsg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * Released under GNU GPL v2 licence 7 | * 8 | * $Id: ReqMsg.cpp,v 1.2 2007-12-03 16:59:17 thomson Exp $ 9 | */ 10 | 11 | #include 12 | #include "ReqMsg.h" 13 | #include "DHCPConst.h" 14 | 15 | using namespace std; 16 | 17 | TReqMsg::TReqMsg(int iface, SPtr addr, int msgType) 18 | :TMsg(iface, addr, msgType) 19 | { 20 | 21 | } 22 | // used to create TMsg object based on received char[] data 23 | TReqMsg::TReqMsg(int iface, SPtr addr, char* &buf, int &bufSize) 24 | :TMsg(iface, addr, buf, bufSize) 25 | { 26 | 27 | } 28 | 29 | 30 | std::string TReqMsg::getName() const 31 | { 32 | switch (MsgType) { 33 | case LEASEQUERY_MSG: 34 | return "LEASEQUERY"; 35 | case LEASEQUERY_REPLY_MSG: 36 | return "LEASEQUERY_RSP"; 37 | default: 38 | return "unknown"; 39 | } 40 | } 41 | 42 | void TReqMsg::addOption(SPtr opt) 43 | { 44 | Options.push_back(opt); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Port-win32/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . 2 | 3 | dist_noinst_DATA = addrpack.c client-win32.cpp ClntService.cpp ClntService.h dibbler-config.h 4 | dist_noinst_DATA += client-win32.vs2013.rc client-win32.vs2013.vcxproj client-win32.vs2013.vcxproj.filters 5 | dist_noinst_DATA += dibbler-requestor.rc lowlevel-win32.c relay-win32.cpp stdbool.h 6 | dist_noinst_DATA += relay-win32.vs2013.rc relay-win32.vs2013.vcxproj relay-win32.vs2013.vcxproj.filters 7 | dist_noinst_DATA += RelService.cpp RelService.h 8 | dist_noinst_DATA += requestor-win32.vs2013.vcxproj requestor-win32.vs2013.vcxproj.filters 9 | dist_noinst_DATA += resource1.h resource2.h resource8.h resource.h 10 | dist_noinst_DATA += resource-requestor.h server-win32.cpp 11 | dist_noinst_DATA += server-win32.vs2013.rc server-win32.vs2013.vcxproj server-win32.vs2013.vcxproj.filters 12 | dist_noinst_DATA += SrvService.cpp SrvService.h unistd.h WinService.cpp WinService.h 13 | dist_noinst_DATA += client.log client-win32.ico dibbler32.iss dibbler64.iss dibbler-win32.vs2017.sln relay.log 14 | dist_noinst_DATA += relay-win32.ico server.log server-win32.ico 15 | -------------------------------------------------------------------------------- /ClntCfgMgr/ClntCfgTA.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * 6 | * released under GNU GPL v2 licence 7 | * 8 | * $Id: ClntCfgTA.cpp,v 1.3 2007-01-07 20:18:44 thomson Exp $ 9 | */ 10 | 11 | #include "ClntCfgTA.h" 12 | #include 13 | #include 14 | #include "Logger.h" 15 | using namespace std; 16 | 17 | TClntCfgTA::TClntCfgTA() { 18 | static unsigned long lastIAID = 1; 19 | this->iaid = lastIAID++; 20 | this->State = STATE_NOTCONFIGURED; 21 | } 22 | 23 | void TClntCfgTA::setState(enum EState state) { 24 | this->State = state; 25 | } 26 | 27 | enum EState TClntCfgTA::getState() { 28 | return this->State; 29 | } 30 | 31 | unsigned long TClntCfgTA::getIAID() { 32 | return this->iaid; 33 | } 34 | 35 | void TClntCfgTA::setIAID(unsigned long iaid) { 36 | this->iaid=iaid; 37 | } 38 | 39 | ostream& operator<<(ostream& out,TClntCfgTA& ta) 40 | { 41 | out << " " << std::endl; 42 | return out; 43 | } 44 | -------------------------------------------------------------------------------- /Port-linux/rt_names.h: -------------------------------------------------------------------------------- 1 | #ifndef RT_NAMES_H_ 2 | #define RT_NAMES_H_ 1 3 | 4 | #include 5 | 6 | char* rtnl_rtprot_n2a(int id, char *buf, int len); 7 | char* rtnl_rtscope_n2a(int id, char *buf, int len); 8 | char* rtnl_rttable_n2a(int id, char *buf, int len); 9 | char* rtnl_rtrealm_n2a(int id, char *buf, int len); 10 | char* rtnl_dsfield_n2a(int id, char *buf, int len); 11 | int rtnl_rtprot_a2n(__u32 *id, char *arg); 12 | int rtnl_rtscope_a2n(__u32 *id, char *arg); 13 | int rtnl_rttable_a2n(__u32 *id, char *arg); 14 | int rtnl_rtrealm_a2n(__u32 *id, char *arg); 15 | int rtnl_dsfield_a2n(__u32 *id, char *arg); 16 | 17 | const char *inet_proto_n2a(int proto, char *buf, int len); 18 | int inet_proto_a2n(char *buf); 19 | 20 | 21 | const char * ll_type_n2a(int type, char *buf, int len); 22 | 23 | const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen); 24 | int ll_addr_a2n(char *lladdr, int len, char *arg); 25 | 26 | const char * ll_proto_n2a(unsigned short id, char *buf, int len); 27 | int ll_proto_a2n(unsigned short *id, char *buf); 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Port-win32/server-win32.vs2013.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource2.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | //#include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // Polish resources 17 | 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | // 21 | // Icon 22 | // 23 | 24 | // Icon with lowest ID value placed first to ensure application icon 25 | // remains consistent on all systems. 26 | IDI_ICON1 ICON "server-win32.ico" 27 | ///////////////////////////////////////////////////////////////////////////// 28 | 29 | 30 | ///////////////////////////////////////////////////////////////////////////// 31 | // English (U.S.) resources 32 | 33 | 34 | -------------------------------------------------------------------------------- /ClntOptions/ClntOptElapsed.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Dibbler - a portable DHCPv6 3 | * 4 | * authors: Tomasz Mrugalski 5 | * Marek Senderski 6 | * 7 | * released under GNU GPL v2 only licence 8 | * 9 | * $Id: ClntOptElapsed.cpp,v 1.8 2008-08-29 00:07:28 thomson Exp $ 10 | * 11 | */ 12 | 13 | #include "Portable.h" 14 | #include "DHCPConst.h" 15 | #include "ClntOptElapsed.h" 16 | #include "Logger.h" 17 | 18 | TClntOptElapsed::TClntOptElapsed( char * buf, int n, TMsg* parent) 19 | :TOptInteger(OPTION_ELAPSED_TIME, OPTION_ELAPSED_TIME_LEN, buf,n, parent) 20 | { 21 | Timestamp = (uint32_t)time(NULL); 22 | } 23 | 24 | TClntOptElapsed::TClntOptElapsed(TMsg* parent) 25 | :TOptInteger(OPTION_ELAPSED_TIME, OPTION_ELAPSED_TIME_LEN, 0, parent) 26 | { 27 | Timestamp = (uint32_t)time(NULL); 28 | } 29 | 30 | bool TClntOptElapsed::doDuties() 31 | { 32 | return false; 33 | } 34 | 35 | char * TClntOptElapsed::storeSelf(char* buf) 36 | { 37 | Value = (unsigned int)((uint32_t)time(NULL) - Timestamp)*100; 38 | return TOptInteger::storeSelf(buf); 39 | } 40 | --------------------------------------------------------------------------------