mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 12:23:25 +00:00
Added a simple embedded GPL dhcp server for ReactOS by
Carlos Manuel Duclos Vergara TODO: Make it a real Window Service Make it use the registry rather than dhcpd.conf ....... svn path=/trunk/; revision=11198
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,3 @@
|
||||
Carlos Duclos Vergara, <carlos at embedded dot cl>
|
||||
Pablo Bleyer Kocik, <pbleyer at embedded dot cl>
|
||||
Manuel Jander, <mjander at embedded dot cl>
|
||||
@@ -0,0 +1,222 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
@@ -0,0 +1,18 @@
|
||||
2002020701:
|
||||
- I rewrite completely the code to get an ip.
|
||||
- I delete threads beacuse of some deadlocks.
|
||||
- I add _finally_ support for static ip host.
|
||||
|
||||
2002013002:
|
||||
- After some web surf and some hack there is (i hope so!) a windows port, please BE CAREFULL because i have no way to test it.
|
||||
|
||||
2002013001:
|
||||
- After a lot of work, this is finally working and now is being ported to auto GNU tools.
|
||||
- I will add the routines to compile it under MSW boxes with winsock.
|
||||
|
||||
20020121:
|
||||
- Well, we have a working version with configuration file and with reduced functionality. If you find bugs, please report them. This version is the last and i'm accepting patches for this version.
|
||||
20020117:
|
||||
- Finally there is an alpha release. From now i will start logging what i'm doing.
|
||||
This alpha release was compiled in a SuSE Linux 7.2 box, i've tested it with my embedded device
|
||||
and it works. I've tested with one MS Windows 98 workstations and it doesn't work.
|
||||
@@ -0,0 +1,188 @@
|
||||
NOTE:
|
||||
->*nix Systems: use the configure script and everything should work without problems.
|
||||
->MSW: FIRST you need the mingw compiler (i think cygwin must work too, but you will have to modify the configure.in and change MINGW32 for CYGWIN)
|
||||
Then, run configure and pray. If it finds everything it needs (the only thing missed may be the pthreads library) is ready to compile.
|
||||
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
@@ -0,0 +1 @@
|
||||
SUBDIRS = src
|
||||
@@ -0,0 +1,352 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CC = @CC@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SUBDIRS = src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS TODO aclocal.m4 config.h.in config.h.top \
|
||||
configure configure.in install-sh missing mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h 2> /dev/null
|
||||
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) config.h.top
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" = "." && dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist
|
||||
-rm -rf $(distdir)
|
||||
@banner="$(distdir).tar.gz is ready for distribution"; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile config.h
|
||||
all-redirect: all-recursive-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
install-data-recursive uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,2 @@
|
||||
20020130:
|
||||
Finally autoconf and company are working. Now i will work on windows port.
|
||||
@@ -0,0 +1,19 @@
|
||||
Disclaimer:
|
||||
This project is released under GPL, see COPYING to get an idea of what this means.
|
||||
|
||||
Building:
|
||||
To build this you need a C compiler (i used gcc 2.95-3), and some luck.
|
||||
Just type make, i'm working on autoconf and automake but is not finished yet.
|
||||
|
||||
Running:
|
||||
For some reason in some circumstances you have to add the following to your route table:
|
||||
route add -host 255.255.255.255 dev eth0
|
||||
That is needed to allow the distribution of packets to the address 255.255.255.255 (as said in RFC 1531).
|
||||
|
||||
NOTE FOR WINDOWS USERS:
|
||||
I don't know how to add that route in MSW systems, looku yourself for help on that.
|
||||
|
||||
|
||||
Comments:
|
||||
Well, comments are always welcome. It doesn't matter if you want to tell me that i suck. If you find some bug and want to report it please do it to my email at:
|
||||
[email protected] with subject [ecl-dhcp]. If the circumstances allow that i will create a mail list.
|
||||
@@ -0,0 +1,6 @@
|
||||
Embedded DHCP Server for ReactOS - Carlos Manuel Duclos Vergara
|
||||
|
||||
TODO:
|
||||
Make it a real Windows Service
|
||||
Use the registry rather than a config file
|
||||
Fix a few races and check to see how it can scale.
|
||||
@@ -0,0 +1,8 @@
|
||||
There are two kind of things, the essentials and the optionals.
|
||||
|
||||
Optionals:
|
||||
- Implement a way to bypass the IP stack and send packets directly.
|
||||
- Sort and beauty the code, maybe rewritting in C++.
|
||||
|
||||
Essentials:
|
||||
- Compile it and test it in MS Windows platforms(work in progress).
|
||||
Vendored
+104
@@ -0,0 +1,104 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# This file is a shell script that caches the results of configure
|
||||
# tests run on this system so they can be shared between configure
|
||||
# scripts and configure runs. It is not useful on other systems.
|
||||
# If it contains results you don't want to keep, you may remove or edit it.
|
||||
#
|
||||
# By default, configure uses ./config.cache as the cache file,
|
||||
# creating it if it does not exist already. You can give configure
|
||||
# the --cache-file=FILE option to use a different cache file; that is
|
||||
# what configure does when it calls configure scripts in
|
||||
# subdirectories, so they share the cache.
|
||||
# Giving --cache-file=/dev/null disables caching, for debugging configure.
|
||||
# config.status only pays attention to the cache file if you give it the
|
||||
# --recheck option to rerun configure.
|
||||
#
|
||||
ac_cv_func_socket=${ac_cv_func_socket=yes}
|
||||
ac_cv_header_stdc=${ac_cv_header_stdc=yes}
|
||||
ac_cv_header_unistd_h=${ac_cv_header_unistd_h=yes}
|
||||
ac_cv_mingw32=${ac_cv_mingw32=no}
|
||||
ac_cv_path_install=${ac_cv_path_install='$/usr/bin/install -c'}
|
||||
ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
|
||||
ac_cv_prog_CPP=${ac_cv_prog_CPP='$gcc -E'}
|
||||
ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
|
||||
ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes}
|
||||
ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
|
||||
ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}
|
||||
ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes}
|
||||
@@ -0,0 +1,25 @@
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* #undef MINGW32 */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the <pthread.h> header file. */
|
||||
/* #undef HAVE_PTHREAD_H */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if you have the pthread library (-lpthread). */
|
||||
/* #undef HAVE_LIBPTHREAD */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "dhcptool"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.0.1-alpha"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
#undef MINGW32
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the pthread library (-lpthread). */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#undef MINGW32
|
||||
@@ -0,0 +1,22 @@
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
configure:557: checking for a BSD compatible install
|
||||
configure:610: checking whether build environment is sane
|
||||
configure:667: checking whether make sets ${MAKE}
|
||||
configure:713: checking for working aclocal
|
||||
configure:726: checking for working autoconf
|
||||
configure:739: checking for working automake
|
||||
configure:752: checking for working autoheader
|
||||
configure:765: checking for working makeinfo
|
||||
configure:783: checking for gcc
|
||||
configure:896: checking whether the C compiler (gcc ) works
|
||||
configure:912: gcc -o conftest conftest.c 1>&5
|
||||
configure:938: checking whether the C compiler (gcc ) is a cross-compiler
|
||||
configure:943: checking whether we are using GNU C
|
||||
configure:971: checking whether gcc accepts -g
|
||||
configure:1005: checking how to run the C preprocessor
|
||||
configure:1085: checking for ANSI C header files
|
||||
configure:1192: checking for unistd.h
|
||||
configure:1230: checking for mingw32 environment
|
||||
configure:1262: checking for socket
|
||||
@@ -0,0 +1,251 @@
|
||||
#! /bin/sh
|
||||
# Generated automatically by configure.
|
||||
# Run this file to recreate the current configuration.
|
||||
# This directory was configured as follows,
|
||||
# on host steven:
|
||||
#
|
||||
# ./configure
|
||||
#
|
||||
# Compiler output produced by configure, useful for debugging
|
||||
# configure, is in ./config.log if it exists.
|
||||
|
||||
ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
|
||||
for ac_option
|
||||
do
|
||||
case "$ac_option" in
|
||||
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
|
||||
echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion"
|
||||
exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "./config.status generated by autoconf version 2.13"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "$ac_cs_usage"; exit 0 ;;
|
||||
*) echo "$ac_cs_usage"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
ac_given_srcdir=.
|
||||
ac_given_INSTALL="$/usr/bin/install -c"
|
||||
|
||||
trap 'rm -fr Makefile src/Makefile config.h conftest*; exit 1' 1 2 15
|
||||
|
||||
# Protect against being on the right side of a sed subst in config.status.
|
||||
sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
|
||||
s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
|
||||
/^[ ]*VPATH[ ]*=[^:]*$/d
|
||||
|
||||
s%@SHELL@%/bin/sh%g
|
||||
s%@CFLAGS@%-g -O2%g
|
||||
s%@CPPFLAGS@%%g
|
||||
s%@CXXFLAGS@%%g
|
||||
s%@FFLAGS@%%g
|
||||
s%@DEFS@%-DHAVE_CONFIG_H%g
|
||||
s%@LDFLAGS@%%g
|
||||
s%@LIBS@%%g
|
||||
s%@exec_prefix@%${prefix}%g
|
||||
s%@prefix@%/usr/local%g
|
||||
s%@program_transform_name@%s,x,x,%g
|
||||
s%@bindir@%${exec_prefix}/bin%g
|
||||
s%@sbindir@%${exec_prefix}/sbin%g
|
||||
s%@libexecdir@%${exec_prefix}/libexec%g
|
||||
s%@datadir@%${prefix}/share%g
|
||||
s%@sysconfdir@%${prefix}/etc%g
|
||||
s%@sharedstatedir@%${prefix}/com%g
|
||||
s%@localstatedir@%${prefix}/var%g
|
||||
s%@libdir@%${exec_prefix}/lib%g
|
||||
s%@includedir@%${prefix}/include%g
|
||||
s%@oldincludedir@%/usr/include%g
|
||||
s%@infodir@%${prefix}/info%g
|
||||
s%@mandir@%${prefix}/man%g
|
||||
s%@INSTALL_PROGRAM@%${INSTALL}%g
|
||||
s%@INSTALL_SCRIPT@%${INSTALL_PROGRAM}%g
|
||||
s%@INSTALL_DATA@%${INSTALL} -m 644%g
|
||||
s%@PACKAGE@%dhcptool%g
|
||||
s%@VERSION@%0.0.1-alpha%g
|
||||
s%@ACLOCAL@%aclocal%g
|
||||
s%@AUTOCONF@%autoconf%g
|
||||
s%@AUTOMAKE@%automake%g
|
||||
s%@AUTOHEADER@%autoheader%g
|
||||
s%@MAKEINFO@%makeinfo%g
|
||||
s%@SET_MAKE@%%g
|
||||
s%@CC@%gcc%g
|
||||
s%@CPP@%$gcc -E%g
|
||||
|
||||
CEOF
|
||||
|
||||
# Split the substitutions into bite-sized pieces for seds with
|
||||
# small command number limits, like on Digital OSF/1 and HP-UX.
|
||||
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
|
||||
ac_file=1 # Number of current file.
|
||||
ac_beg=1 # First line for current file.
|
||||
ac_end=$ac_max_sed_cmds # Line after last line for current file.
|
||||
ac_more_lines=:
|
||||
ac_sed_cmds=""
|
||||
while $ac_more_lines; do
|
||||
if test $ac_beg -gt 1; then
|
||||
sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
else
|
||||
sed "${ac_end}q" conftest.subs > conftest.s$ac_file
|
||||
fi
|
||||
if test ! -s conftest.s$ac_file; then
|
||||
ac_more_lines=false
|
||||
rm -f conftest.s$ac_file
|
||||
else
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds="sed -f conftest.s$ac_file"
|
||||
else
|
||||
ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
|
||||
fi
|
||||
ac_file=`expr $ac_file + 1`
|
||||
ac_beg=$ac_end
|
||||
ac_end=`expr $ac_end + $ac_max_sed_cmds`
|
||||
fi
|
||||
done
|
||||
if test -z "$ac_sed_cmds"; then
|
||||
ac_sed_cmds=cat
|
||||
fi
|
||||
|
||||
CONFIG_FILES=${CONFIG_FILES-"Makefile src/Makefile"}
|
||||
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
|
||||
# Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
|
||||
|
||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
||||
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
|
||||
# The file is in a subdirectory.
|
||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
||||
ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
|
||||
# A "../" for each directory in $ac_dir_suffix.
|
||||
ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
|
||||
else
|
||||
ac_dir_suffix= ac_dots=
|
||||
fi
|
||||
|
||||
case "$ac_given_srcdir" in
|
||||
.) srcdir=.
|
||||
if test -z "$ac_dots"; then top_srcdir=.
|
||||
else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
|
||||
/*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
|
||||
*) # Relative path.
|
||||
srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
|
||||
top_srcdir="$ac_dots$ac_given_srcdir" ;;
|
||||
esac
|
||||
|
||||
case "$ac_given_INSTALL" in
|
||||
[/$]*) INSTALL="$ac_given_INSTALL" ;;
|
||||
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
|
||||
esac
|
||||
|
||||
echo creating "$ac_file"
|
||||
rm -f "$ac_file"
|
||||
configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
|
||||
case "$ac_file" in
|
||||
*Makefile*) ac_comsub="1i\\
|
||||
# $configure_input" ;;
|
||||
*) ac_comsub= ;;
|
||||
esac
|
||||
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
sed -e "$ac_comsub
|
||||
s%@configure_input@%$configure_input%g
|
||||
s%@srcdir@%$srcdir%g
|
||||
s%@top_srcdir@%$top_srcdir%g
|
||||
s%@INSTALL@%$INSTALL%g
|
||||
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
|
||||
fi; done
|
||||
rm -f conftest.s*
|
||||
|
||||
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
|
||||
# NAME is the cpp macro being defined and VALUE is the value it is being given.
|
||||
#
|
||||
# ac_d sets the value in "#define NAME VALUE" lines.
|
||||
ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
|
||||
ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
|
||||
ac_dC='\3'
|
||||
ac_dD='%g'
|
||||
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
|
||||
ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
|
||||
ac_uB='\([ ]\)%\1#\2define\3'
|
||||
ac_uC=' '
|
||||
ac_uD='\4%g'
|
||||
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
|
||||
ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
|
||||
ac_eB='$%\1#\2define\3'
|
||||
ac_eC=' '
|
||||
ac_eD='%g'
|
||||
|
||||
if test "${CONFIG_HEADERS+set}" != set; then
|
||||
CONFIG_HEADERS="config.h"
|
||||
fi
|
||||
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
|
||||
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
|
||||
case "$ac_file" in
|
||||
*:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
|
||||
ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
|
||||
*) ac_file_in="${ac_file}.in" ;;
|
||||
esac
|
||||
|
||||
echo creating $ac_file
|
||||
|
||||
rm -f conftest.frag conftest.in conftest.out
|
||||
ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
|
||||
cat $ac_file_inputs > conftest.in
|
||||
|
||||
cat > conftest.frag <<CEOF
|
||||
${ac_dA}PACKAGE${ac_dB}PACKAGE${ac_dC}"dhcptool"${ac_dD}
|
||||
${ac_uA}PACKAGE${ac_uB}PACKAGE${ac_uC}"dhcptool"${ac_uD}
|
||||
${ac_eA}PACKAGE${ac_eB}PACKAGE${ac_eC}"dhcptool"${ac_eD}
|
||||
${ac_dA}VERSION${ac_dB}VERSION${ac_dC}"0.0.1-alpha"${ac_dD}
|
||||
${ac_uA}VERSION${ac_uB}VERSION${ac_uC}"0.0.1-alpha"${ac_uD}
|
||||
${ac_eA}VERSION${ac_eB}VERSION${ac_eC}"0.0.1-alpha"${ac_eD}
|
||||
${ac_dA}STDC_HEADERS${ac_dB}STDC_HEADERS${ac_dC}1${ac_dD}
|
||||
${ac_uA}STDC_HEADERS${ac_uB}STDC_HEADERS${ac_uC}1${ac_uD}
|
||||
${ac_eA}STDC_HEADERS${ac_eB}STDC_HEADERS${ac_eC}1${ac_eD}
|
||||
${ac_dA}HAVE_UNISTD_H${ac_dB}HAVE_UNISTD_H${ac_dC}1${ac_dD}
|
||||
${ac_uA}HAVE_UNISTD_H${ac_uB}HAVE_UNISTD_H${ac_uC}1${ac_uD}
|
||||
${ac_eA}HAVE_UNISTD_H${ac_eB}HAVE_UNISTD_H${ac_eC}1${ac_eD}
|
||||
CEOF
|
||||
sed -f conftest.frag conftest.in > conftest.out
|
||||
rm -f conftest.in
|
||||
mv conftest.out conftest.in
|
||||
|
||||
cat > conftest.frag <<CEOF
|
||||
${ac_dA}HAVE_SOCKET${ac_dB}HAVE_SOCKET${ac_dC}1${ac_dD}
|
||||
${ac_uA}HAVE_SOCKET${ac_uB}HAVE_SOCKET${ac_uC}1${ac_uD}
|
||||
${ac_eA}HAVE_SOCKET${ac_eB}HAVE_SOCKET${ac_eC}1${ac_eD}
|
||||
s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
|
||||
CEOF
|
||||
sed -f conftest.frag conftest.in > conftest.out
|
||||
rm -f conftest.in
|
||||
mv conftest.out conftest.in
|
||||
|
||||
rm -f conftest.frag conftest.h
|
||||
echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
|
||||
cat conftest.in >> conftest.h
|
||||
rm -f conftest.in
|
||||
if cmp -s $ac_file conftest.h 2>/dev/null; then
|
||||
echo "$ac_file is unchanged"
|
||||
rm -f conftest.h
|
||||
else
|
||||
# Remove last slash and all that follows it. Not all systems have dirname.
|
||||
ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
|
||||
if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
|
||||
# The file is in a subdirectory.
|
||||
test ! -d "$ac_dir" && mkdir "$ac_dir"
|
||||
fi
|
||||
rm -f $ac_file
|
||||
mv conftest.h $ac_file
|
||||
fi
|
||||
fi; done
|
||||
|
||||
|
||||
|
||||
exit 0
|
||||
Vendored
+1678
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(src/main.c)
|
||||
|
||||
AM_INIT_AUTOMAKE( dhcptool, 0.0.1-alpha)
|
||||
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl AC_CHECK_LIB(pthread, pthread_create, ,exit)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(unistd.h)
|
||||
dnl AC_CHECK_HEADERS(pthread.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_MINGW32
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_CHECK_FUNCS(socket)
|
||||
|
||||
AC_OUTPUT(Makefile src/Makefile)
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <defines.h>
|
||||
#include <reactos/resource.h>
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
|
||||
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
||||
VALUE "FileDescription", "Event logging service\0"
|
||||
VALUE "FileVersion", RES_STR_FILE_VERSION
|
||||
VALUE "InternalName", "EventLog\0"
|
||||
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
|
||||
VALUE "OriginalFilename", "EventLog.exe\0"
|
||||
VALUE "ProductName", RES_STR_PRODUCT_NAME
|
||||
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,37 @@
|
||||
# $Id: makefile,v 1.1 2004/10/05 13:09:45 sedwards Exp $
|
||||
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_APPTYPE = console
|
||||
|
||||
TARGET_NAME = dhcpd
|
||||
|
||||
TARGET_CFLAGS = \
|
||||
-Wall
|
||||
|
||||
TARGET_CFLAGS += -Isrc/include
|
||||
|
||||
TARGET_SDKLIBS = ws2_32.a
|
||||
|
||||
TARGET_OBJECTS = \
|
||||
src/main.o \
|
||||
src/display/display.o \
|
||||
src/leases/leases.o \
|
||||
src/lock/locker.o \
|
||||
src/parsing/parser.o \
|
||||
src/utils/iputils.o \
|
||||
src/utils/macutils.o
|
||||
|
||||
# src/utils/wutils.o
|
||||
|
||||
DEP_OBJECTS = $(TARGET_OBJECTS)
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
include $(TOOLS_PATH)/depend.mk
|
||||
|
||||
# EOF
|
||||
@@ -0,0 +1,190 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
# Franc,ois Pinard <[email protected]>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing - GNU libit 0.0"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`configure.in'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`configure.in'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`configure.in'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,40 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <[email protected]>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id: mkinstalldirs,v 1.1 2004/10/05 13:09:45 sedwards Exp $
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
@@ -0,0 +1,8 @@
|
||||
# DHCP CONFIGURATION, DO NOT ERASE OR MOVE THIS LINE!
|
||||
subnet 192.168.2.0
|
||||
lease 30
|
||||
range 2 5
|
||||
mask 255.255.255.0
|
||||
router 192.168.2.1
|
||||
server 192.168.2.1
|
||||
# DHCP CONFIGURATION, DO NOT ERASE OR MOVE THIS LINE!
|
||||
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,6 @@
|
||||
SUBDIRS = display leases parsing utils
|
||||
INCLUDES = -Iinclude
|
||||
CFLAGS = display.o leases.o parser.o utils.o -Wall
|
||||
bin_PROGRAMS = dhcp
|
||||
dhcp_SOURCES = main.c
|
||||
dhcp_OBJS = display.o leases.o parser.o utils.o
|
||||
@@ -0,0 +1,388 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CC = @CC@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SUBDIRS = display leases parsing utils
|
||||
INCLUDES = -Iinclude
|
||||
CFLAGS = display.o leases.o parser.o utils.o -Wall
|
||||
bin_PROGRAMS = dhcp
|
||||
dhcp_SOURCES = main.c
|
||||
dhcp_OBJS = display.o leases.o parser.o utils.o
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
dhcp_OBJECTS = main.o
|
||||
dhcp_LDADD = $(LDADD)
|
||||
dhcp_DEPENDENCIES =
|
||||
dhcp_LDFLAGS =
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
DEP_FILES = .deps/main.P
|
||||
SOURCES = $(dhcp_SOURCES)
|
||||
OBJECTS = $(dhcp_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
done
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
dhcp: $(dhcp_OBJECTS) $(dhcp_DEPENDENCIES)
|
||||
@rm -f dhcp
|
||||
$(LINK) $(dhcp_LDFLAGS) $(dhcp_OBJECTS) $(dhcp_LDADD) $(LIBS)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" = "." && dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = src
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
here=`cd $(top_builddir) && pwd`; \
|
||||
top_distdir=`cd $(top_distdir) && pwd`; \
|
||||
distdir=`cd $(distdir) && pwd`; \
|
||||
cd $(top_srcdir) \
|
||||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||
|
||||
-include $(DEP_FILES)
|
||||
|
||||
mostlyclean-depend:
|
||||
|
||||
clean-depend:
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf .deps
|
||||
|
||||
maintainer-clean-depend:
|
||||
|
||||
%.o: %.c
|
||||
@echo '$(COMPILE) -c $<'; \
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
|
||||
@-cp .deps/$(*F).pp .deps/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*F).P; \
|
||||
rm .deps/$(*F).pp
|
||||
|
||||
%.lo: %.c
|
||||
@echo '$(LTCOMPILE) -c $<'; \
|
||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
|
||||
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
||||
< .deps/$(*F).pp > .deps/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*F).P; \
|
||||
rm -f .deps/$(*F).pp
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
install-exec-am: install-binPROGRAMS
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
all-redirect: all-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
|
||||
mostlyclean-tags mostlyclean-depend mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
|
||||
distclean-depend distclean-generic clean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
|
||||
maintainer-clean-am: maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-depend maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
|
||||
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile install-data-recursive \
|
||||
uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir \
|
||||
mostlyclean-depend distclean-depend clean-depend \
|
||||
maintainer-clean-depend info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,9 @@
|
||||
# DHCP CONFIGURATION, DO NOT ERASE OR MOVE THIS LINE!
|
||||
subnet 192.168.2.0
|
||||
lease 30
|
||||
range 2 5
|
||||
mask 255.255.255.0
|
||||
router 192.168.2.1
|
||||
server 192.168.2.1
|
||||
host 52:54:40:22:65:BD 192.168.2.200
|
||||
# DHCP CONFIGURATION, DO NOT ERASE OR MOVE THIS LINE!
|
||||
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,63 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
#include <display.h>
|
||||
#include <options.h>
|
||||
|
||||
int display_dhcp_packet( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
|
||||
{
|
||||
char *mtype;
|
||||
if( dhcpm == NULL )
|
||||
return -1;
|
||||
|
||||
fprintf( stdout, "op: %s\t|htype: %s\t|hlen: %u\t|hops: %u\n", (dhcpm->op == 1)?"BOOTREQUEST":"BOOTREPLY", (dhcpm->htype==1)?"Ethernet 10Mb":"unknown", dhcpm->hlen, dhcpm->hops);
|
||||
fprintf( stdout, "xid: %u \n", dhcpm->xid );
|
||||
fprintf( stdout, "secs: %u\t\t|flags: %u\n", dhcpm->secs, dhcpm->flags );
|
||||
fprintf( stdout, "ciaddr: %u.%u.%u.%u \n", (dhcpm->ciaddr >> 24), ((dhcpm->ciaddr>>16)&0xFF), ((dhcpm->ciaddr>>8)&0xFF), ((dhcpm->ciaddr)&0xFF));
|
||||
fprintf( stdout, "yiaddr: %u.%u.%u.%u \n", (dhcpm->yiaddr >> 24), ((dhcpm->yiaddr>>16)&0xFF), ((dhcpm->yiaddr>>8)&0xFF), ((dhcpm->yiaddr)&0xFF));
|
||||
fprintf( stdout, "siaddr: %u.%u.%u.%u \n", (dhcpm->siaddr >> 24), ((dhcpm->siaddr>>16)&0xFF), ((dhcpm->siaddr>>8)&0xFF), ((dhcpm->siaddr)&0xFF));
|
||||
fprintf( stdout, "giaddr: %u.%u.%u.%u \n", (dhcpm->giaddr >> 24), ((dhcpm->giaddr>>16)&0xFF), ((dhcpm->giaddr>>8)&0xFF), ((dhcpm->giaddr)&0xFF));
|
||||
fprintf( stdout, "chaddr: %X::%X::%X::%X::%X::%X \n", dhcpm->chaddr[0], dhcpm->chaddr[1], dhcpm->chaddr[2], dhcpm->chaddr[3], dhcpm->chaddr[4], dhcpm->chaddr[5] );
|
||||
fprintf( stdout, "sname: %s \n", dhcpm->sname );
|
||||
fprintf( stdout, "file: %s \n", dhcpm->file );
|
||||
/* options come here */
|
||||
switch( dhcpo->type )
|
||||
{
|
||||
case DHCPDISCOVER:
|
||||
mtype = (char *)malloc( strlen( "DHCPDISCOVER" ) +1);
|
||||
strcpy( mtype, "DHCPDISCOVER" );
|
||||
break;
|
||||
case DHCPREQUEST:
|
||||
mtype = (char *)malloc( strlen( "DHCPREQUEST" ) +1);
|
||||
strcpy( mtype, "DHCPREQUEST" );
|
||||
break;
|
||||
case DHCPACK:
|
||||
mtype = (char *)malloc( strlen( "DHCPACK" ) +1);
|
||||
strcpy( mtype, "DHCPACK" );
|
||||
break;
|
||||
case DHCPNAK:
|
||||
mtype = (char *)malloc( strlen( "DHCPNAK" ) +1);
|
||||
strcpy( mtype, "DHCPNAK" );
|
||||
break;
|
||||
case DHCPRELEASE:
|
||||
mtype = (char *)malloc( strlen( "DHCPRELEASE" ) +1);
|
||||
strcpy( mtype, "DHCPRELEASE" );
|
||||
break;
|
||||
case DHCPDECLINE:
|
||||
mtype = (char *)malloc( strlen( "DHCPDECLINE" ) +1);
|
||||
strcpy( mtype, "DHCPDECLINE" );
|
||||
break;
|
||||
case DHCPOFFER:
|
||||
mtype = (char *)malloc( strlen( "DHCPOFFER" ) +1);
|
||||
strcpy( mtype, "DHCPOFFER" );
|
||||
break;
|
||||
default:
|
||||
mtype = (char *)malloc( strlen("Unknown Type") +1);
|
||||
strcpy( mtype, "Unknown Type" );
|
||||
break;
|
||||
}
|
||||
fprintf( stdout, "Message Type: %s \n", mtype );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#ifndef DATATYPES_H
|
||||
#define DATATYPES_H
|
||||
|
||||
typedef unsigned char u8b;
|
||||
typedef unsigned short u16b;
|
||||
typedef unsigned int u32b;
|
||||
|
||||
typedef struct{
|
||||
u8b op;
|
||||
u8b htype;
|
||||
u8b hlen;
|
||||
u8b hops;
|
||||
u32b xid;
|
||||
u16b secs;
|
||||
u16b flags;
|
||||
u32b ciaddr;
|
||||
u32b yiaddr;
|
||||
u32b siaddr;
|
||||
u32b giaddr;
|
||||
u8b chaddr[16];
|
||||
u8b sname[64];
|
||||
u8b file[128];
|
||||
u8b options[312];
|
||||
} DHCPMESSAGE;
|
||||
|
||||
typedef struct{
|
||||
u8b type;
|
||||
u32b r_ip;
|
||||
u32b r_mask;
|
||||
u32b r_router;
|
||||
u32b r_lease;
|
||||
char *hostname;
|
||||
} DHCPOPTIONS;
|
||||
|
||||
typedef struct{
|
||||
u32b ip;
|
||||
u32b router;
|
||||
u32b mask;
|
||||
u32b lease;
|
||||
u32b siaddr;
|
||||
} DHCPLEASE;
|
||||
|
||||
struct _DHCPLIST{
|
||||
u8b available;
|
||||
u32b xid;
|
||||
u8b chaddr[16];
|
||||
u8b type;
|
||||
u32b ltime;
|
||||
DHCPLEASE data;
|
||||
struct _DHCPLIST *next;
|
||||
struct _DHCPLIST *back;
|
||||
};
|
||||
|
||||
typedef struct _DHCPLIST DHCPLIST;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef DISPLAY_H
|
||||
#define DISPLAY_H
|
||||
|
||||
int display_dhcp_packet( DHCPMESSAGE *, DHCPOPTIONS *);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef HEADERS_H
|
||||
#define HEADERS_H
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
#include <winsock.h>
|
||||
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef IPUTILS_H
|
||||
#define IPUTILS_H
|
||||
|
||||
int split_ip( char *, u8b *, int );
|
||||
int get_ip( char *, u32b * );
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef LEASES_H
|
||||
#define LEASES_H
|
||||
|
||||
extern DHCPLIST *list;
|
||||
int find_lease( DHCPLEASE *, u32b, u8b * );
|
||||
int init_leases_list();
|
||||
int confirm_lease( DHCPLEASE *, u32b );
|
||||
int release_lease( DHCPLEASE *, u32b, u8b * );
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef LOCK_H
|
||||
#define LOCK_H
|
||||
|
||||
extern DHCPLIST *leased_list;
|
||||
|
||||
int check_leased_list();
|
||||
static int test_and_set();
|
||||
int lock_list();
|
||||
int unlock_list();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef MACUTILS_H
|
||||
#define MACUTILS_H
|
||||
|
||||
int maccmp( u8b *, u8b *);
|
||||
int maccpy( u8b *, u8b *);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,115 @@
|
||||
/* This software is GPL, see http://www.gnu.org to see exactly what it means */
|
||||
|
||||
/* This file contains some useful constant declarations */
|
||||
|
||||
#ifndef OPTIONS_H
|
||||
#define OPTIONS_H
|
||||
|
||||
#define VERSION "ecl-dhcp-0.0.2-snoopy"
|
||||
|
||||
#define MAX_PROCESS_TIME 15
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#define BOOTREQUEST 0x1
|
||||
#define BOOTREPLY 0x2
|
||||
|
||||
/* Message types */
|
||||
|
||||
#define DHCPDISCOVER 0x1
|
||||
#define DHCPOFFER 0x2
|
||||
#define DHCPREQUEST 0x3
|
||||
#define DHCPDECLINE 0x4
|
||||
#define DHCPACK 0x5
|
||||
#define DHCPNAK 0x6
|
||||
#define DHCPRELEASE 0x7
|
||||
#define DHCPINFORM 0x8
|
||||
|
||||
|
||||
#define PAD 0x00
|
||||
#define MASK 0x01
|
||||
#define TOFFSET 0x02
|
||||
#define ROUTER 0x03
|
||||
#define TIMESERVER 0x04
|
||||
#define NS 0x05
|
||||
#define DNS 0x06
|
||||
#define LOGSERVER 0x07
|
||||
#define COOKIESERVER 0x08
|
||||
#define LPRSERVER 0x09
|
||||
#define IMPSERVER 0x0A
|
||||
#define RESLOCSERVER 0x0B
|
||||
#define HOSTNAME 0x0C
|
||||
#define BOOTFILESIZE 0x0D
|
||||
#define MERITDUMPFILE 0x0E
|
||||
#define DOMAINNAME 0x0F
|
||||
#define SWAPSERVER 0x10
|
||||
#define ROOTPATH 0x11
|
||||
#define EXTENSIONPATH 0x12
|
||||
#define IPFORWARD 0x13
|
||||
#define NONLOCAL 0x14
|
||||
#define POLICYFILTER 0x15
|
||||
#define MAXIMUMDATAG 0x16
|
||||
#define DEFAULTTTL 0x17
|
||||
#define PATHMTUATO 0x18
|
||||
#define PATHMTUPTO 0x19
|
||||
#define IMTU 0x1A
|
||||
#define ALLSUBLOCAL 0x1B
|
||||
#define BROADCAST 0x1C
|
||||
#define PMASKDISCOVERY 0x1D
|
||||
#define MASKSUPPLIER 0x1E
|
||||
#define PROUTERDISCOVE 0x1F
|
||||
#define RSOLICIADDRESS 0x20
|
||||
#define STATICROUTE 0x21
|
||||
#define TENCAPSULATION 0x22
|
||||
#define ARPCACHE 0x23
|
||||
#define ETHENCAPSUL 0x24
|
||||
#define TCPDEFTTL 0x25
|
||||
#define TCPKAI 0x26
|
||||
#define TCPKAG 0x27
|
||||
#define NISDOMAIN 0x28
|
||||
#define NISSERVER 0x29
|
||||
#define NTPSERVER 0x2A
|
||||
#define VENDORSP 0x2B
|
||||
#define NBTCPIPNS 0x2C
|
||||
#define NBTCPIPDDS 0x2D
|
||||
#define NBTCPIPNT 0x2E
|
||||
#define NBTCPIPSC 0x2F
|
||||
#define XWINFONTSERVER 0x30
|
||||
#define XWINDISPLAY 0x31
|
||||
#define IP 0x32
|
||||
#define LEASE 0x33
|
||||
#define OVERLOAD 0x34
|
||||
#define MESSAGETYPE 0x35
|
||||
#define SERVER 0x36
|
||||
#define PREQUEST 0x37
|
||||
#define MESSAGE 0x38
|
||||
#define MAXIMUMDHCP 0x39
|
||||
#define RENEWALTIME 0x3A
|
||||
#define REBINDING 0x3B
|
||||
#define VENDORCLASS 0x3C
|
||||
#define CLIENT 0x3D
|
||||
#define NISPLUSDOMAIN 0x40
|
||||
#define NISPLUSSERVER 0x41
|
||||
#define TFTPSERVER 0x42
|
||||
#define BOOTFILE 0x43
|
||||
#define MOBILEIP 0x44
|
||||
#define SMTPSERVER 0x45
|
||||
#define POP3SERVER 0x46
|
||||
#define NNTPSERVER 0x47
|
||||
#define HTTPSERVER 0x48
|
||||
#define FINGERSERVER 0x49
|
||||
#define IRCSERVER 0x4A
|
||||
#define STREETTALKSE 0x4B
|
||||
#define STREETTALKDA 0x4C
|
||||
#define END 0xFF
|
||||
|
||||
/* Constants */
|
||||
#define FREE 0x01
|
||||
#define PROCESSING 0x02
|
||||
#define BUSY 0x00
|
||||
|
||||
#define DYNAMIC 0x00
|
||||
#define STATIC 0x01
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef PARSER_H
|
||||
#define PARSER_H
|
||||
|
||||
int parse_dhcp_options( DHCPMESSAGE *, DHCPOPTIONS *);
|
||||
int process_dhcp_packet( DHCPMESSAGE *, DHCPOPTIONS *);
|
||||
int write_packet( DHCPMESSAGE *, char *);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <macutils.h>
|
||||
#include <iputils.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef WUTILS_H
|
||||
#define WUTILS_H
|
||||
|
||||
u8b try_lock( u8b * );
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,233 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
#include <display.h>
|
||||
#include <options.h>
|
||||
#include <leases.h>
|
||||
#include <utils.h>
|
||||
|
||||
int init_leases_list()
|
||||
{
|
||||
DHCPLIST *temp;
|
||||
int i, j;
|
||||
u8b chaddr[16];
|
||||
FILE *config;
|
||||
char line[80];
|
||||
char textsubnet[16];
|
||||
char textlease[5];
|
||||
char textrouter[16];
|
||||
char textmask[16];
|
||||
char textlowrange[4], texthighrange[4];
|
||||
char textserver[16];
|
||||
u8b ip0, ip1, ip2, ip3;
|
||||
u8b lowrange, highrange;
|
||||
u8b textmac[17], textip[16];
|
||||
u32b lease;
|
||||
|
||||
/* Be nice variables and behave yourselves */
|
||||
|
||||
for( j = 0; j < 16; j++ )
|
||||
{
|
||||
chaddr[j] = 0;
|
||||
textsubnet[j] = 0;
|
||||
textrouter[j] = 0;
|
||||
textmask[j] = 0;
|
||||
textip[j] = 0;
|
||||
textmac[j] = 0;
|
||||
}
|
||||
|
||||
textlease[0] = 0;
|
||||
textlowrange[0] = 0;
|
||||
texthighrange[0] = 0;
|
||||
|
||||
/* Now we can read our configuration file */
|
||||
|
||||
config = fopen( "dhcp.conf", "r" );
|
||||
if( !config )
|
||||
{
|
||||
perror("Reading config files");
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
/* We _DO_ need a better parser */
|
||||
list = (DHCPLIST *)malloc( sizeof( DHCPLIST ));
|
||||
temp = list;
|
||||
temp->back = NULL;
|
||||
|
||||
while( (!feof( config )) && ( line ))
|
||||
{
|
||||
fscanf( config, "%s", line);
|
||||
if( !strcmp( line, "subnet" ))
|
||||
/* Read subnet parameters */
|
||||
fscanf( config, "%s", textsubnet );
|
||||
|
||||
if( !strcmp( line, "lease" ))
|
||||
/* read lease parameters */
|
||||
fscanf( config, "%s", textlease );
|
||||
|
||||
if( !strcmp( line, "router" ))
|
||||
fscanf( config, "%s", textrouter );
|
||||
|
||||
if( !strcmp( line, "mask" ))
|
||||
fscanf( config, "%s", textmask );
|
||||
|
||||
if( !strcmp( line, "range" ))
|
||||
fscanf( config, "%s %s", textlowrange, texthighrange );
|
||||
if( !strcmp( line, "server" ))
|
||||
fscanf( config, "%s", textserver );
|
||||
if( !strcmp( line, "host" ))
|
||||
{
|
||||
/* Host Specific Configuration */
|
||||
fscanf( config, "%s %s", textmac, textip );
|
||||
str2mac( textmac, temp->chaddr );
|
||||
temp->type = STATIC;
|
||||
temp->data.ip = inet_addr( textip );
|
||||
temp->next = (DHCPLIST *)malloc( sizeof( DHCPLIST ));
|
||||
temp->next->back = temp;
|
||||
temp = temp->next;
|
||||
temp->next =NULL;
|
||||
}
|
||||
}
|
||||
fclose( config );
|
||||
|
||||
lowrange = (u8b)atoi( textlowrange );
|
||||
highrange = (u8b)atoi( texthighrange );
|
||||
lease = (u32b)atoi( textlease );
|
||||
|
||||
/* Creating Static IP */
|
||||
|
||||
for( temp = list; temp->next; temp = temp->next )
|
||||
{
|
||||
temp->available = FREE;
|
||||
temp->xid = 0;
|
||||
temp->data.router = inet_addr( textrouter );
|
||||
temp->data.mask = inet_addr( textmask );
|
||||
temp->data.lease = lease;
|
||||
temp->data.siaddr = inet_addr( textserver );
|
||||
}
|
||||
|
||||
/* Creating Dynamic IP */
|
||||
|
||||
for( i = lowrange; i < (highrange + 1); i++ )
|
||||
{
|
||||
temp->available = FREE;
|
||||
temp->xid = 0;
|
||||
temp->type = DYNAMIC;
|
||||
maccpy( temp->chaddr, chaddr );
|
||||
split_ip( textsubnet, &ip0, 0 );
|
||||
split_ip( textsubnet, &ip1, 1 );
|
||||
split_ip( textsubnet, &ip2, 2 );
|
||||
temp->data.ip = i;
|
||||
temp->data.ip = temp->data.ip << 8;
|
||||
temp->data.ip += ip2;
|
||||
temp->data.ip = temp->data.ip << 8;
|
||||
temp->data.ip += ip1;
|
||||
temp->data.ip = temp->data.ip << 8;
|
||||
temp->data.ip += ip0;
|
||||
temp->data.router = inet_addr( textrouter );
|
||||
temp->data.mask = inet_addr( textmask );
|
||||
temp->data.lease = lease;
|
||||
temp->data.siaddr = inet_addr( textserver );
|
||||
temp->next = (DHCPLIST *)malloc( sizeof( DHCPLIST ));
|
||||
temp->next->back = temp;
|
||||
temp = temp->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int find_lease( DHCPLEASE *dhcpl, u32b xid, u8b chaddr[] )
|
||||
{
|
||||
int result = -2;
|
||||
DHCPLIST *temp;
|
||||
|
||||
if( !dhcpl )
|
||||
return -1;
|
||||
|
||||
for( temp = list; temp; temp=temp->next )
|
||||
if( !maccmp( temp->chaddr, chaddr ) )
|
||||
release_lease( dhcpl, xid, chaddr);
|
||||
|
||||
for( temp = list; temp; temp=temp->next )
|
||||
if( ( !maccmp( temp->chaddr, chaddr )) && ( temp->type == STATIC ))
|
||||
{
|
||||
dhcpl->ip = temp->data.ip;
|
||||
dhcpl->router = temp->data.router;
|
||||
dhcpl->mask = temp->data.mask;
|
||||
dhcpl->lease = temp->data.lease;
|
||||
dhcpl->siaddr = temp->data.siaddr;
|
||||
fprintf( stdout, "Assigning Static IP! \n");
|
||||
temp->available = PROCESSING;
|
||||
temp->xid = xid;
|
||||
temp->ltime = MAX_PROCESS_TIME;
|
||||
maccpy( temp->chaddr, chaddr);
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
else if( ( temp->available & FREE ) && ( temp->type == DYNAMIC ))
|
||||
{
|
||||
dhcpl->ip = temp->data.ip;
|
||||
dhcpl->router = temp->data.router;
|
||||
dhcpl->mask = temp->data.mask;
|
||||
dhcpl->lease = temp->data.lease;
|
||||
dhcpl->siaddr = temp->data.siaddr;
|
||||
fprintf( stdout, "Assigning Dynamic IP! \n");
|
||||
temp->available = PROCESSING;
|
||||
temp->xid = xid;
|
||||
temp->ltime = MAX_PROCESS_TIME;
|
||||
maccpy( temp->chaddr, chaddr);
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int confirm_lease( DHCPLEASE *dhcpl, u32b xid )
|
||||
{
|
||||
int result = -1;
|
||||
DHCPLIST *temp;
|
||||
|
||||
for( temp = list; temp; temp=temp->next )
|
||||
if( temp->xid == xid )
|
||||
{
|
||||
dhcpl->ip = temp->data.ip;
|
||||
dhcpl->router = temp->data.router;
|
||||
dhcpl->mask = temp->data.mask;
|
||||
dhcpl->lease = temp->data.lease;
|
||||
dhcpl->siaddr = temp->data.siaddr;
|
||||
temp->available = BUSY;
|
||||
temp->ltime = temp->data.lease;
|
||||
result = 0;
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int release_lease( DHCPLEASE *dhcpl, u32b xid, u8b chaddr[16] )
|
||||
{
|
||||
int result = -1, i;
|
||||
DHCPLIST *temp;
|
||||
u8b nchaddr[16];
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
nchaddr[i] = 0;
|
||||
|
||||
if( !dhcpl )
|
||||
return -1;
|
||||
|
||||
for( temp = list; temp; temp=temp->next )
|
||||
if( !maccmp( temp->chaddr, chaddr ) )
|
||||
{
|
||||
/* We found the address */
|
||||
result = 0;
|
||||
fprintf( stdout, "Deleting %X::%X::%X::%X::%X::%X \n", temp->chaddr[0], temp->chaddr[1], temp->chaddr[2], temp->chaddr[3], temp->chaddr[4], temp->chaddr[5] );
|
||||
temp->available = FREE;
|
||||
temp->xid = 0;
|
||||
/* maccpy( temp->chaddr, nchaddr ); */
|
||||
} else {
|
||||
/* No such address */
|
||||
result = -1;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
#include <options.h>
|
||||
#include <leases.h>
|
||||
#include <lock.h>
|
||||
|
||||
int check_leased_list()
|
||||
{
|
||||
DHCPLIST *temp, *ntemp;
|
||||
int count = 1, i;
|
||||
|
||||
/* fprintf( stdout, "checking list! \n" ); */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_and_set()
|
||||
{
|
||||
/* Test lock, if it's locked return FALSE */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int lock_list()
|
||||
{
|
||||
int count = 1;
|
||||
|
||||
while( !test_and_set() )
|
||||
{
|
||||
sleep( 1 );
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int unlock_list()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
#include <options.h>
|
||||
#include <display.h>
|
||||
#include <leases.h>
|
||||
#include <parser.h>
|
||||
|
||||
#define MYPORT 67
|
||||
DHCPLIST *list;
|
||||
/*DHCPLIST *leased_list;*/
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
WSADATA wsaData;
|
||||
int nCode;
|
||||
#endif
|
||||
int sockfd;
|
||||
struct sockaddr_in my_addr;
|
||||
struct sockaddr_in their_addr;
|
||||
int addr_len, numbytes;
|
||||
DHCPMESSAGE dhcpm;
|
||||
DHCPOPTIONS dhcpo;
|
||||
|
||||
#ifdef __MINGW32__
|
||||
if ((nCode = WSAStartup(MAKEWORD(1, 1), &wsaData)) != 0)
|
||||
{
|
||||
perror("WSAStartup");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
|
||||
perror("socket");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
init_leases_list();
|
||||
|
||||
my_addr.sin_family = AF_INET;
|
||||
my_addr.sin_port = htons(MYPORT);
|
||||
my_addr.sin_addr.s_addr = INADDR_ANY;
|
||||
memset(&(my_addr.sin_zero), '\0', 8);
|
||||
|
||||
if (bind(sockfd, (struct sockaddr *)&my_addr,
|
||||
sizeof(struct sockaddr)) == -1) {
|
||||
perror("bind");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
addr_len = sizeof(struct sockaddr);
|
||||
while((numbytes=recvfrom(sockfd,&dhcpm, sizeof( DHCPMESSAGE ), 0,
|
||||
(struct sockaddr *)&their_addr, &addr_len)) != -1) {
|
||||
/* Parse DHCP */
|
||||
display_dhcp_packet( &dhcpm, &dhcpo );
|
||||
if( parse_dhcp_options( &dhcpm, &dhcpo ) < 0 )
|
||||
continue;
|
||||
if( display_dhcp_packet( &dhcpm, &dhcpo ) < 0 )
|
||||
continue;
|
||||
if( process_dhcp_packet( &dhcpm, &dhcpo ) < 0 )
|
||||
continue;
|
||||
}
|
||||
|
||||
close(sockfd);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,404 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
#include <display.h>
|
||||
#include <parser.h>
|
||||
#include <leases.h>
|
||||
#include <options.h>
|
||||
|
||||
int parse_dhcp_options( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
|
||||
{
|
||||
int pointer, opointer;
|
||||
int olength;
|
||||
|
||||
pointer = 0;
|
||||
|
||||
fprintf( stdout, "parse_dhcp_options [begin]!\n");
|
||||
|
||||
/* Options Initialization */
|
||||
/* No message type */
|
||||
dhcpo->type = 0;
|
||||
/* No ip address, 0.0.0.0 */
|
||||
dhcpo->r_ip = 0;
|
||||
/* No mask address, 0.0.0.0 */
|
||||
dhcpo->r_mask = 0;
|
||||
/* No router, 0.0.0.0 */
|
||||
dhcpo->r_router = 0;
|
||||
/* No lease 0 */
|
||||
dhcpo->r_lease = 0;
|
||||
/* No name '\n' */
|
||||
dhcpo->hostname = NULL;
|
||||
|
||||
while( pointer< 312 )
|
||||
{
|
||||
if(( dhcpm->options[0] != 99 ) && (dhcpm->options[1]!=130) && (dhcpm->options[2]!=83) && (dhcpm->options[3]!= 99))
|
||||
{
|
||||
fprintf( stdout, "No magic cookie! Aborting! \n" );
|
||||
return -1;
|
||||
}
|
||||
switch( dhcpm->options[pointer] ){
|
||||
case PAD:
|
||||
pointer++;
|
||||
break;
|
||||
case MESSAGETYPE:
|
||||
/* Try to figure out the kind of message and start the configuring process */
|
||||
pointer += 2;
|
||||
dhcpo->type = dhcpm->options[pointer++];
|
||||
break;
|
||||
case PREQUEST:
|
||||
/* Take note of the requested parameters */
|
||||
opointer = pointer + 2;
|
||||
olength = pointer + dhcpm->options[pointer + 1];
|
||||
while( opointer < olength )
|
||||
{
|
||||
switch( dhcpm->options[opointer] ){
|
||||
case IP:
|
||||
/* Take note of the requested ip */
|
||||
opointer += 2;
|
||||
dhcpo->r_ip += dhcpm->options[opointer++];
|
||||
dhcpo->r_ip = dhcpo->r_ip << 8;
|
||||
dhcpo->r_ip += dhcpm->options[opointer++];
|
||||
dhcpo->r_ip = dhcpo->r_ip << 8;
|
||||
dhcpo->r_ip += dhcpm->options[opointer++];
|
||||
dhcpo->r_ip = dhcpo->r_ip << 8;
|
||||
dhcpo->r_ip += dhcpm->options[opointer++];
|
||||
break;
|
||||
case MASK:
|
||||
/* Take note of the requested mask */
|
||||
opointer += 2;
|
||||
dhcpo->r_mask += dhcpm->options[opointer++];
|
||||
dhcpo->r_mask = dhcpo->r_ip << 8;
|
||||
dhcpo->r_mask += dhcpm->options[opointer++];
|
||||
dhcpo->r_mask = dhcpo->r_ip << 8;
|
||||
dhcpo->r_mask += dhcpm->options[opointer++];
|
||||
dhcpo->r_mask = dhcpo->r_ip << 8;
|
||||
dhcpo->r_mask += dhcpm->options[opointer++];
|
||||
break;
|
||||
case ROUTER:
|
||||
/* Take note of the requested router */
|
||||
opointer += 2;
|
||||
dhcpo->r_router += dhcpm->options[opointer++];
|
||||
dhcpo->r_router = dhcpo->r_ip << 8;
|
||||
dhcpo->r_router += dhcpm->options[opointer++];
|
||||
dhcpo->r_router = dhcpo->r_ip << 8;
|
||||
dhcpo->r_router += dhcpm->options[opointer++];
|
||||
dhcpo->r_router = dhcpo->r_ip << 8;
|
||||
dhcpo->r_router += dhcpm->options[opointer++];
|
||||
break;
|
||||
case LEASE:
|
||||
opointer += 2;
|
||||
dhcpo->r_lease += dhcpm->options[opointer++];
|
||||
dhcpo->r_lease = dhcpo->r_ip << 8;
|
||||
dhcpo->r_lease += dhcpm->options[opointer++];
|
||||
dhcpo->r_lease = dhcpo->r_ip << 8;
|
||||
dhcpo->r_lease += dhcpm->options[opointer++];
|
||||
dhcpo->r_lease = dhcpo->r_ip << 8;
|
||||
dhcpo->r_lease += dhcpm->options[opointer++];
|
||||
break;
|
||||
case HOSTNAME:
|
||||
opointer += 1;
|
||||
dhcpo->hostname = (char *)malloc( dhcpm->options[opointer] + 1);
|
||||
strncpy( dhcpo->hostname, &dhcpm->options[opointer+1], dhcpm->options[opointer] );
|
||||
opointer += dhcpm->options[opointer] + 1;
|
||||
default:
|
||||
/* Ignore option */
|
||||
opointer++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pointer = opointer;
|
||||
break;
|
||||
case TOFFSET:
|
||||
case TIMESERVER:
|
||||
case NS:
|
||||
case DNS:
|
||||
case LOGSERVER:
|
||||
case COOKIESERVER:
|
||||
case LPRSERVER:
|
||||
case IMPSERVER:
|
||||
case RESLOCSERVER:
|
||||
case BOOTFILESIZE:
|
||||
case MERITDUMPFILE:
|
||||
case DOMAINNAME:
|
||||
case SWAPSERVER:
|
||||
case ROOTPATH:
|
||||
case EXTENSIONPATH:
|
||||
case IPFORWARD:
|
||||
case NONLOCAL:
|
||||
case POLICYFILTER:
|
||||
case MAXIMUMDATAG:
|
||||
case DEFAULTTTL:
|
||||
case PATHMTUATO:
|
||||
case PATHMTUPTO:
|
||||
case IMTU:
|
||||
case ALLSUBLOCAL:
|
||||
case BROADCAST:
|
||||
case PMASKDISCOVERY:
|
||||
case MASKSUPPLIER:
|
||||
case PROUTERDISCOVE:
|
||||
case RSOLICIADDRESS:
|
||||
case STATICROUTE:
|
||||
case TENCAPSULATION:
|
||||
case ARPCACHE:
|
||||
case ETHENCAPSUL:
|
||||
case TCPDEFTTL:
|
||||
case TCPKAI:
|
||||
case TCPKAG:
|
||||
case NISDOMAIN:
|
||||
case NISSERVER:
|
||||
case NTPSERVER:
|
||||
case VENDORSP:
|
||||
case NBTCPIPNS:
|
||||
case NBTCPIPDDS:
|
||||
case NBTCPIPNT:
|
||||
case NBTCPIPSC:
|
||||
case XWINFONTSERVER:
|
||||
case XWINDISPLAY:
|
||||
case OVERLOAD:
|
||||
case SERVER:
|
||||
case MESSAGE:
|
||||
case MAXIMUMDHCP:
|
||||
case RENEWALTIME:
|
||||
case REBINDING:
|
||||
case VENDORCLASS:
|
||||
case NISPLUSDOMAIN:
|
||||
case NISPLUSSERVER:
|
||||
case TFTPSERVER:
|
||||
case BOOTFILE:
|
||||
case MOBILEIP:
|
||||
case SMTPSERVER:
|
||||
case POP3SERVER:
|
||||
case NNTPSERVER:
|
||||
case HTTPSERVER:
|
||||
case FINGERSERVER:
|
||||
case IRCSERVER:
|
||||
case STREETTALKSE:
|
||||
case STREETTALKDA:
|
||||
case CLIENT:
|
||||
pointer++;
|
||||
pointer += dhcpm->options[pointer];
|
||||
case END:
|
||||
/* return to the calling functions because this is over */
|
||||
fprintf( stdout, "parse_dhcp_options: END option found! [end]!\n");
|
||||
return 0;
|
||||
default:
|
||||
/* ignored */
|
||||
pointer++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fprintf( stdout, "parse_dhcp_options [end]!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int process_dhcp_packet( DHCPMESSAGE *dhcpm, DHCPOPTIONS *dhcpo )
|
||||
{
|
||||
int pointer = 4;
|
||||
DHCPLEASE dhcpl;
|
||||
char *name;
|
||||
|
||||
fprintf( stdout, "process_dhcp_packet [begin]!\n");
|
||||
|
||||
if( (!dhcpm) || (!dhcpo) )
|
||||
return -1;
|
||||
|
||||
name = (char *)malloc( 16 );
|
||||
switch( dhcpo->type ){
|
||||
|
||||
case DHCPDISCOVER:
|
||||
/* We need to send a DHCPOFFER */
|
||||
if( find_lease( &dhcpl, dhcpm->xid, dhcpm->chaddr ) < 0 )
|
||||
{
|
||||
fprintf( stdout, "No free leases! \n" );
|
||||
return -1;
|
||||
}
|
||||
dhcpm->op = BOOTREPLY;
|
||||
dhcpm->yiaddr = dhcpl.ip;
|
||||
dhcpm->siaddr = dhcpl.siaddr;
|
||||
strcpy(dhcpm->sname, VERSION);
|
||||
dhcpm->options[pointer++] = MESSAGETYPE;
|
||||
dhcpm->options[pointer++] = 1;
|
||||
dhcpm->options[pointer++] = DHCPOFFER;
|
||||
dhcpm->options[pointer++] = ROUTER;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.router & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.router >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.router >> 16) &0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.router >> 24);
|
||||
dhcpm->options[pointer++] = MASK;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.mask & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.mask >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.mask >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.mask >> 24);
|
||||
dhcpm->options[pointer++] = SERVER;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.siaddr & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.siaddr >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.siaddr >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.siaddr >> 24);
|
||||
dhcpm->options[pointer++] = LEASE;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.lease >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.lease & 0xFF);
|
||||
dhcpm->options[pointer++] = REBINDING;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.lease >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.lease & 0xFF) - 5;
|
||||
dhcpm->options[pointer++] = RENEWALTIME;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.lease >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.lease & 0xFF) - 5;
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = END;
|
||||
for( ; pointer < 312; pointer++ )
|
||||
dhcpm->options[pointer] = PAD;
|
||||
dhcpo->type = DHCPOFFER;
|
||||
strcpy( name, "255.255.255.255" );
|
||||
break;
|
||||
|
||||
case DHCPREQUEST:
|
||||
/* We need to send an DHCPACK */
|
||||
dhcpm->op = BOOTREPLY;
|
||||
dhcpm->yiaddr = dhcpm->ciaddr;
|
||||
strcpy(dhcpm->sname, VERSION);
|
||||
if( confirm_lease( &dhcpl, dhcpm->xid ) < 0)
|
||||
{
|
||||
dhcpm->options[pointer++] = MESSAGETYPE;
|
||||
dhcpm->options[pointer++] = 1;
|
||||
dhcpm->options[pointer++] = DHCPNAK;
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = END;
|
||||
for( ; pointer < 312; pointer++ )
|
||||
dhcpm->options[pointer] = PAD;
|
||||
sprintf( name, "%u.%u.%u.%u", (dhcpm->ciaddr &0xFF), ((dhcpm->ciaddr>>8)&0xFF), ((dhcpm->ciaddr>>16)&0xFF), ((dhcpm->ciaddr>>24)&0xFF));
|
||||
display_dhcp_packet( dhcpm, dhcpo );
|
||||
write_packet( dhcpm, name );
|
||||
return -1;
|
||||
}
|
||||
dhcpm->siaddr = dhcpl.siaddr;
|
||||
dhcpm->options[pointer++] = MESSAGETYPE;
|
||||
dhcpm->options[pointer++] = 1;
|
||||
dhcpm->options[pointer++] = DHCPACK;
|
||||
dhcpm->options[pointer++] = ROUTER;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.router >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.router >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.router >> 8) &0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.router & 0xFF);
|
||||
dhcpm->options[pointer++] = MASK;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.mask >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.mask >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.mask >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.mask & 0xFF);
|
||||
dhcpm->options[pointer++] = SERVER;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = dhcpl.siaddr >> 24;
|
||||
dhcpm->options[pointer++] = ((dhcpl.siaddr >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.siaddr >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.siaddr & 0xFF);
|
||||
dhcpm->options[pointer++] = LEASE;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.lease >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.lease & 0xFF);
|
||||
dhcpm->options[pointer++] = REBINDING;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.lease >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.lease & 0xFF);
|
||||
dhcpm->options[pointer++] = RENEWALTIME;
|
||||
dhcpm->options[pointer++] = 4;
|
||||
dhcpm->options[pointer++] = (dhcpl.lease >> 24);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 16) & 0xFF);
|
||||
dhcpm->options[pointer++] = ((dhcpl.lease >> 8) & 0xFF);
|
||||
dhcpm->options[pointer++] = (dhcpl.lease & 0xFF);
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = PAD;
|
||||
dhcpm->options[pointer++] = END;
|
||||
for( ; pointer < 312; pointer++ )
|
||||
dhcpm->options[pointer] = PAD;
|
||||
dhcpo->type = DHCPACK;
|
||||
sprintf( name, "%u.%u.%u.%u", (dhcpl.ip & 0xFF), ((dhcpl.ip>>8) & 0xFF), ((dhcpl.ip>>16)&0xFF), (dhcpl.ip>>24));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
display_dhcp_packet( dhcpm, dhcpo );
|
||||
write_packet( dhcpm, name );
|
||||
fprintf( stdout, "process_dhcp_packet [end]!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int write_packet( DHCPMESSAGE *dhcpm, char *name )
|
||||
{
|
||||
int sockfd;
|
||||
struct sockaddr_in their_addr; // connector's address information
|
||||
struct hostent *he;
|
||||
int numbytes;
|
||||
int enable = 1;
|
||||
|
||||
fprintf( stdout, "write_packet [begin]\n" );
|
||||
|
||||
if( !dhcpm )
|
||||
return -1;
|
||||
|
||||
if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
|
||||
perror("socket");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if( setsockopt( sockfd, SOL_SOCKET, SO_BROADCAST, &enable, sizeof( enable )) == -1 )
|
||||
{
|
||||
perror("setsockopt");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if( strcmp( "255.255.255.255", name ) )
|
||||
{
|
||||
if ((he=gethostbyname(name)) == NULL) { // get the host info
|
||||
perror("gethostbyname");
|
||||
fprintf( stdout, "Unknown host %s \n", name );
|
||||
return -1;
|
||||
}
|
||||
their_addr.sin_family = AF_INET; // host byte order
|
||||
their_addr.sin_port = htons(68); // short, network byte order
|
||||
their_addr.sin_addr = *((struct in_addr *)he->h_addr);
|
||||
} else {
|
||||
their_addr.sin_family = AF_INET; // host byte order
|
||||
their_addr.sin_port = htons(68); // short, network byte order
|
||||
their_addr.sin_addr.s_addr = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
fprintf( stdout, "IP a buscar: %s \n", name );
|
||||
memset(&(their_addr.sin_zero), '\0', 8); // zero the rest of the struct
|
||||
|
||||
if ((numbytes=sendto(sockfd, dhcpm, sizeof(DHCPMESSAGE), 0,
|
||||
(struct sockaddr *)&their_addr, sizeof(struct sockaddr))) == -1) {
|
||||
perror("sendto");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("sent %d bytes to %s\n", numbytes,
|
||||
inet_ntoa(their_addr.sin_addr));
|
||||
|
||||
close(sockfd);
|
||||
|
||||
fprintf( stdout, "write_packet [end]\n" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
*.coff
|
||||
*.d
|
||||
*.o
|
||||
*.sym
|
||||
*.exe
|
||||
*.map
|
||||
@@ -0,0 +1,59 @@
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
#include <options.h>
|
||||
#include <utils.h>
|
||||
|
||||
int split_ip( char *text, u8b *dest, int place )
|
||||
{
|
||||
int dotcount;
|
||||
|
||||
/* Don't touch this, unless you like pointer aritmethic */
|
||||
|
||||
*dest = 0;
|
||||
|
||||
if( !text )
|
||||
return -1;
|
||||
|
||||
for( dotcount = 0; (dotcount < place) && ( text ); text++ )
|
||||
if( *text == '.' )
|
||||
dotcount++;
|
||||
|
||||
if( !text )
|
||||
return -2;
|
||||
|
||||
while(( *text != '.' ) && ( *text != '\0' ))
|
||||
{
|
||||
*dest *= 10;
|
||||
*dest += (u8b)(*text-48);
|
||||
/* 48 is not a hack, is just the code of 0 */
|
||||
text++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_ip( char *text, u32b *dest )
|
||||
{
|
||||
/* Don't touch this, unless you like pointer aritmethic */
|
||||
|
||||
*dest = 0;
|
||||
|
||||
if( !text )
|
||||
return -1;
|
||||
|
||||
while( *text != '\0' )
|
||||
{
|
||||
if( *text == '.' )
|
||||
{
|
||||
*dest = *dest << 8;
|
||||
text++;
|
||||
continue;
|
||||
}
|
||||
*dest *= 10;
|
||||
*dest += (u8b)(*text-48);
|
||||
/* 48 is not a hack, is just the code of 0 */
|
||||
text++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#include <headers.h>
|
||||
#include <datatypes.h>
|
||||
|
||||
int maccpy( u8b dest[16], u8b source[16] )
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i < 16; i++ )
|
||||
dest[i] = source[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
int maccmp( u8b dest[16], u8b source[16] )
|
||||
{
|
||||
int i;
|
||||
char equal = 0;
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
if( dest[i] != source[i] )
|
||||
equal = -1;
|
||||
|
||||
return equal;
|
||||
}
|
||||
|
||||
int str2mac( u8b from[17], u8b to[16] )
|
||||
{
|
||||
int i, j, length;
|
||||
u8b buffer;
|
||||
u8b dif;
|
||||
|
||||
length = (int)strlen( from );
|
||||
|
||||
for( i = 0, j = 0; i < length; )
|
||||
{
|
||||
buffer = 0;
|
||||
while( (from[i] != ':' ) && (from[i]!= '\0' ))
|
||||
{
|
||||
buffer = buffer << 4;
|
||||
(from[i]>57)?(dif=55):(dif=48);
|
||||
buffer += (from[i] - dif);
|
||||
i++;
|
||||
}
|
||||
to[j++] = buffer;
|
||||
i++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef MACUTILS_H
|
||||
#define MACUTILS_H
|
||||
|
||||
int maccmp( u8b *, u8b *);
|
||||
int maccpy( u8b *, u8b *);
|
||||
int str2mac( u8b *, u8b * );
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <macutils.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <options.h>
|
||||
#include <wutils.h>
|
||||
|
||||
u8b try_lock( u8b *key )
|
||||
{
|
||||
if( *key == TRUE )
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
timestamp
|
||||
@@ -0,0 +1 @@
|
||||
timestamp
|
||||
Reference in New Issue
Block a user