Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed May 21, 2013
0 parents commit fa5defb
Show file tree
Hide file tree
Showing 12 changed files with 1,403 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
erl_crash.dump
ebin
.eunit
deps
priv
*.o
*.beam
*.plt
70 changes: 70 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
REBAR = $(shell pwd)/rebar

.PHONY: deps rel package

all: deps compile

compile:
$(REBAR) compile

deps:
$(REBAR) get-deps

clean:
$(REBAR) clean

distclean: clean
$(REBAR) delete-deps

test: all
$(REBAR) skip_deps=true eunit

###
### Docs
###
docs:
$(REBAR) skip_deps=true doc

##
## Developer targets
##

xref:
$(REBAR) xref skip_deps=true

console: all
erl -pa ebin deps/*/ebin -s dhcp -config standalone.config


##
## Dialyzer
##
APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
xmerl webtool snmp public_key mnesia eunit syntax_tools compiler
COMBO_PLT = $(HOME)/.dhcp_combo_dialyzer_plt


check_plt: deps compile
dialyzer --check_plt --plt $(COMBO_PLT) --apps $(APPS) \
deps/*/ebin ebin

build_plt: deps compile
dialyzer --build_plt --output_plt $(COMBO_PLT) --apps $(APPS) \
deps/*/ebin ebin

dialyzer: deps compile
@echo
@echo Use "'make check_plt'" to check PLT prior to using this target.
@echo Use "'make build_plt'" to build PLT prior to using this target.
@echo
@sleep 1
dialyzer -Wno_return --plt $(COMBO_PLT) deps/*/ebin ebin | grep -v -f dialyzer.mittigate


cleanplt:
@echo
@echo "Are you sure? It takes about 1/2 hour to re-build."
@echo Deleting $(COMBO_PLT) in 5 seconds.
@echo
sleep 5
rm $(COMBO_PLT)
Binary file added rebar
Binary file not shown.
6 changes: 6 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{lib_dirs, ["deps"]}.
{erl_opts, [{parse_transform, lager_transform}, debug_info, warnings_as_errors]}.
{deps,
[
{lager, ".*", {git, "git://github.com/basho/lager.git", {tag, "1.2.2"}}}
]}.
13 changes: 13 additions & 0 deletions src/dhcp.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{application, dhcp,
[
{description, ""},
{vsn, "0.1.0"},
{registered, []},
{applications, [
kernel,
lager,
stdlib
]},
{mod, { dhcp_app, []}},
{env, []}
]}.
18 changes: 18 additions & 0 deletions src/dhcp.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-record(dhcp_package,
{op = request,
htype = unknown,
hlen = 0,
hops = 0,
xid = 0,
secs = 0,
flags = [],
ciaddr = 0,
yiaddr = 0,
siaddr = 0,
giaddr = 0,
chaddr = [],
sname = <<>>,
file = <<>>,
options = [],
message_type
}).
16 changes: 16 additions & 0 deletions src/dhcp_app.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-module(dhcp_app).

-behaviour(application).

%% Application callbacks
-export([start/2, stop/1]).

%% ===================================================================
%% Application callbacks
%% ===================================================================

start(_StartType, _StartArgs) ->
dhcp_sup:start_link().

stop(_State) ->
ok.
Loading

0 comments on commit fa5defb

Please sign in to comment.