~henrik-ziegeldorf/hipl/pisa

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# Copyright (c) 2010 Aalto University and RWTH Aachen University.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

ACLOCAL_AMFLAGS  = -I m4

HIPL_HEADER_LOCATIONS = firewall/*.h hipd/*.h lib/*/*.h modules/*/*/*.h test/*.h test/*/*.h test/*/*/*.h
HIPL_HEADER_LIST = $(wildcard $(addprefix $(srcdir)/,$(HIPL_HEADER_LOCATIONS)))

# For "make dist"
EXTRA_DIST =  .vimrc debian doc patches version.h .uncrustify.cfg
EXTRA_DIST += .uncrustify-0.57.cfg tools/bazaar/plugins/stylecheck.py
EXTRA_DIST += packaging process_modules.py tools/maintainer
EXTRA_DIST += $(wildcard modules/*/module_info.xml)
EXTRA_DIST += $(wildcard modules/*/Makefile.am) $(wildcard modules/*/*/*.c)
EXTRA_DIST += $(wildcard $(addprefix $(srcdir)/tools/,*.cfg *.pl *.sh *.xml))
EXTRA_DIST += $(wildcard $(addprefix $(srcdir)/firewall/,*.cfg))
EXTRA_DIST += $(HIPL_HEADER_LIST)


### user programs ###
bin_PROGRAMS = test/auth_performance    \
               test/certteststub        \
               test/hc_performance

if HIP_PERFORMANCE
bin_PROGRAMS += test/dh_performance
endif


### superuser programs ###
sbin_PROGRAMS = hipd/hipd      \
                tools/hipconf  \
                tools/pisacert

if HIP_FIREWALL
sbin_PROGRAMS += firewall/hipfw
endif


### test programs ###
noinst_PROGRAMS = test/fw_port_bindings_performance



### libraries ###
lib_LTLIBRARIES = lib/core/libhipcore.la


### tests ###
if HIP_UNITTESTS
TESTS           = test/check_firewall \
                  test/check_lib_core \
                  test/check_lib_tool
check_PROGRAMS  = test/check_firewall \
                  test/check_lib_core \
                  test/check_lib_tool
endif


### source declarations ###

test_auth_performance_SOURCES               = test/auth_performance.c
test_certteststub_SOURCES                   = test/certteststub.c
test_dh_performance_SOURCES                 = test/dh_performance.c
test_fw_port_bindings_performance_SOURCES   = test/fw_port_bindings_performance.c \
                                              firewall/file_buffer.c              \
                                              firewall/line_parser.c              \
                                              firewall/port_bindings.c
test_hc_performance_SOURCES                 = test/hc_performance.c

tools_hipconf_SOURCES  = tools/hipconf.c
tools_pisacert_SOURCES = tools/pisacert.c

hipd_hipd_SOURCES = hipd/accessor.c              \
                    hipd/close.c                 \
                    hipd/configfilereader.c      \
                    hipd/cookie.c                \
                    hipd/dh.c                    \
                    hipd/esp_prot_anchordb.c     \
                    hipd/esp_prot_hipd_msg.c     \
                    hipd/esp_prot_light_update.c \
                    hipd/hadb.c                  \
                    hipd/hadb_legacy.c           \
                    hipd/hidb.c                  \
                    hipd/hip_socket.c            \
                    hipd/hipd.c                  \
                    hipd/hiprelay.c              \
                    hipd/hit_to_ip.c             \
                    hipd/init.c                  \
                    hipd/input.c                 \
                    hipd/keymat.c                \
                    hipd/maintenance.c           \
                    hipd/nat.c                   \
                    hipd/netdev.c                \
                    hipd/nsupdate.c              \
                    hipd/opp_mode.c              \
                    hipd/output.c                \
                    hipd/pkt_handling.c          \
                    hipd/pisa_community_operator.c \
                    hipd/registration.c          \
                    hipd/user.c                  \
                    hipd/user_ipsec_hipd_msg.c   \
                    hipd/user_ipsec_sadb_api.c

firewall_hipfw_sources = firewall/cache.c               \
                         firewall/dlist.c               \
                         firewall/esp_prot_api.c        \
                         firewall/esp_prot_config.c     \
                         firewall/esp_prot_conntrack.c  \
                         firewall/esp_prot_fw_msg.c     \
                         firewall/file_buffer.c         \
                         firewall/firewall.c            \
                         firewall/firewall_control.c    \
                         firewall/helpers.c             \
                         firewall/hslist.c              \
                         firewall/line_parser.c         \
                         firewall/lsi.c                 \
                         firewall/midauth.c             \
                         firewall/pisa.c                \
                         firewall/port_bindings.c       \
                         firewall/reinject.c            \
                         firewall/rewrite.c             \
                         firewall/rule_management.c     \
                         firewall/user_ipsec_api.c      \
                         firewall/user_ipsec_esp.c      \
                         firewall/user_ipsec_fw_msg.c   \
                         firewall/user_ipsec_sadb.c

# The firewall unit test program is linked against the firewall object files.
# To avoid duplicate symbols during linking some object files need to excluded.
# Add all files that need to be excluded here.
firewall_hipfw_SOURCES = $(firewall_hipfw_sources) \
                         firewall/conntrack.c      \
                         firewall/main.c

lib_core_libhipcore_la_SOURCES = lib/core/builder.c         \
                                 lib/core/capability.c      \
                                 lib/core/cert.c            \
                                 lib/core/certtools.c       \
                                 lib/core/conf.c            \
                                 lib/core/crypto.c          \
                                 lib/core/debug.c           \
                                 lib/core/esp_prot_common.c \
                                 lib/core/filemanip.c       \
                                 lib/core/hashchain.c       \
                                 lib/core/hashchain_store.c \
                                 lib/core/hashtable.c       \
                                 lib/core/hashtree.c        \
                                 lib/core/hip_udp.c         \
                                 lib/core/hit.c             \
                                 lib/core/hostid.c          \
                                 lib/core/hostsfiles.c      \
                                 lib/core/keylen.c          \
                                 lib/core/linkedlist.c      \
                                 lib/core/message.c         \
                                 lib/core/modularization.c  \
                                 lib/core/prefix.c          \
                                 lib/core/solve.c           \
                                 lib/core/statistics.c      \
                                 lib/core/straddr.c         \
                                 lib/core/transform.c       \
                                 lib/tool/checksum.c        \
                                 lib/tool/lutil.c           \
                                 lib/tool/nlink.c           \
                                 lib/tool/pk.c              \
                                 lib/tool/xfrmapi.c

if HIP_PERFORMANCE
lib_core_libhipcore_la_SOURCES += lib/core/performance.c
endif


test_check_firewall_SOURCES = test/check_firewall.c          \
                              test/mocks.c                   \
                              test/firewall/conntrack.c      \
                              test/firewall/file_buffer.c    \
                              test/firewall/helpers.c        \
                              test/firewall/line_parser.c    \
                              test/firewall/port_bindings.c  \
                              $(firewall_hipfw_sources)

test_check_lib_core_SOURCES = test/check_lib_core.c          \
                              test/lib/core/cert.c           \
                              test/lib/core/hit.c            \
                              test/lib/core/solve.c          \
                              test/lib/core/straddr.c

test_check_lib_tool_SOURCES = test/check_lib_tool.c          \
                              test/lib/tool/checksum.c

# Include module Makefile.am's.
# TODO: Make this inclusion dynamic
include modules/heartbeat/Makefile.am
include modules/heartbeat_update/Makefile.am
include modules/pisa/Makefile.am
include modules/midauth/Makefile.am
include modules/update/Makefile.am

### static library dependencies ###

firewall_hipfw_LDADD                     = lib/core/libhipcore.la
hipd_hipd_LDADD                          = lib/core/libhipcore.la
test_auth_performance_LDADD              = lib/core/libhipcore.la
test_check_firewall_LDADD                = lib/core/libhipcore.la
test_check_lib_core_LDADD                = lib/core/libhipcore.la
test_check_lib_tool_LDADD                = lib/core/libhipcore.la
test_certteststub_LDADD                  = lib/core/libhipcore.la
test_dh_performance_LDADD                = lib/core/libhipcore.la
test_fw_port_bindings_performance_LDADD  = lib/core/libhipcore.la
test_hc_performance_LDADD                = lib/core/libhipcore.la
tools_hipconf_LDADD                      = lib/core/libhipcore.la
tools_pisacert_LDADD                     = lib/core/libhipcore.la

### dynamic library dependencies ###

test_check_firewall_LDFLAGS              = -ldl

dist_sbin_SCRIPTS = tools/hipdnskeyparse/hipdnskeyparse \
                    tools/hipdnsproxy/hipdnsproxy       \
                    tools/nsupdate.pl

dns_PYTHON = tools/hipdnsproxy/DNS/__init__.py      \
             tools/hipdnsproxy/DNS/Base.py          \
             tools/hipdnsproxy/DNS/Class.py         \
             tools/hipdnsproxy/DNS/lazy.py          \
             tools/hipdnsproxy/DNS/Lib.py           \
             tools/hipdnsproxy/DNS/Opcode.py        \
             tools/hipdnsproxy/DNS/Serialization.py \
             tools/hipdnsproxy/DNS/Status.py        \
             tools/hipdnsproxy/DNS/Type.py          \
             tools/hipdnsproxy/DNS/win32dns.py

dnsdir = $(pythondir)/DNS

tools_hipdnskeyparse_PYTHON = tools/hipdnskeyparse/myasn.py

tools_hipdnsproxy_PYTHON = tools/hipdnsproxy/hosts.py       \
                           tools/hipdnsproxy/pyip6.py       \
                           tools/hipdnsproxy/util.py

tools_hipdnskeyparsedir = $(pythondir)/hipdnskeyparse
tools_hipdnsproxydir    = $(pythondir)/hipdnsproxy


### misc stuff ###

# This is supposed to be a sanity check target to run before pushing changes
# to the world at large. It should catch a number of easily-avoidable mistakes.
alltests: doxygen checkheaders check distcheck

doxygen: doc/Doxyfile
	doxygen $<

if HAVE_XMLTO
nodist_doc_DATA = doc/HOWTO.html doc/HOWTO.txt $(wildcard $(addprefix $(srcdir)/doc/,*.png))
endif

doc/HOWTO.html:  doc/HOWTO.xml
	xmlto -o $(@D) html-nochunks $<

doc/HOWTO.txt: doc/HOWTO.xml
	xmlto -o $(@D) txt $<

CLEANFILES = doc/HOWTO.html doc/HOWTO.txt
clean-local:
	rm -rf doc/doxy rpmbuild

bin deb rpm syncrepo syncrepo_deb syncrepo_rpm: $(srcdir)/version.h
	@srcdir@/packaging/create-package.sh $@

autotools-clean: maintainer-clean
	rm -f aclocal.m4 compile config.* configure depcomp install-sh
	rm -f ltmain.sh m4/*.m4 Makefile.in missing py-compile

HIPL_HEADER_OBJS     = $(subst $(srcdir),$(builddir),$(HIPL_HEADER_LIST:.h=.ho))
CLEANFILES          += $(HIPL_HEADER_OBJS)
DISTCLEANFILES       = $(wildcard modules/*.h)

$(HIPL_HEADER_OBJS): $(BUILT_SOURCES)
checkheaders: $(HIPL_HEADER_OBJS)
vpath %.h $(srcdir)
%.ho: %.h
	$(AM_V_CC) $(CC) -I$(srcdir) -I$(builddir) $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ $<

BUILT_SOURCES = version.h
$(srcdir)/version.h: $(wildcard $(srcdir)/.bzr/checkout/dirstate)
	bzr version-info $(srcdir) --custom --template='#define VCS_REVISION "{revno}"\n#define VCS_DATE "{date}"\n#define VCS_BRANCH "{branch_nick}"\n' > $@


# Files that are generated by configure should not be distributed.
dist-hook:
	rm -f $(addprefix $(distdir)/doc/,Doxyfile HOWTO.xml)
	rm -f $(addprefix $(distdir)/tools/,nsupdate.pl hipdnsproxy/hipdnsproxy hipdnskeyparse/hipdnskeyparse)
	rm -f $(addprefix $(distdir)/debian/,hipl-dnsproxy.dirs hipl-dnsproxy.install)

.PHONY: alltests bin checkheaders deb doxygen rpm syncrepo*