From ee8c45689526ca973407cbb77bce7b96a062c40b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 12 Aug 2014 01:41:42 +0200 Subject: networkd: add minimal client tool "networkd" to query network status In the long run this should become a full fledged client to networkd (but not before networkd learns bus support). For now, just pull interesting data out of networkd, udev, and rtnl and present it to the user, in a simple but useful output. --- Makefile.am | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index ce8f2472ee..2d00fcec46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -833,6 +833,8 @@ libsystemd_shared_la_SOURCES = \ src/shared/errno-list.h \ src/shared/af-list.c \ src/shared/af-list.h \ + src/shared/arphrd-list.c \ + src/shared/arphrd-list.h \ src/shared/audit.c \ src/shared/audit.h \ src/shared/xml.c \ @@ -864,7 +866,9 @@ nodist_libsystemd_shared_la_SOURCES = \ src/shared/errno-from-name.h \ src/shared/errno-to-name.h \ src/shared/af-from-name.h \ - src/shared/af-to-name.h + src/shared/af-to-name.h \ + src/shared/arphrd-from-name.h \ + src/shared/arphrd-to-name.h libsystemd_shared_la_CFLAGS = \ $(AM_CFLAGS) \ @@ -1150,6 +1154,8 @@ CLEANFILES += \ src/shared/errno-from-name.gperf \ src/shared/af-list.txt \ src/shared/af-from-name.gperf \ + src/shared/arphrd-list.txt \ + src/shared/arphrd-from-name.gperf \ src/shared/dns_type-list.txt \ src/shared/dns_type-from-name.gperf @@ -1158,6 +1164,8 @@ BUILT_SOURCES += \ src/shared/errno-to-name.h \ src/shared/af-from-name.h \ src/shared/af-to-name.h \ + src/shared/arphrd-from-name.h \ + src/shared/arphrd-to-name.h \ src/resolve/dns_type-from-name.h \ src/resolve/dns_type-to-name.h @@ -1170,7 +1178,7 @@ BUILT_SOURCES += \ src/shared/errno-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - $@ + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - $@ src/shared/errno-to-name.h: src/shared/errno-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ @@ -1178,11 +1186,21 @@ src/shared/errno-to-name.h: src/shared/errno-list.txt src/shared/af-list.txt: $(AM_V_at)$(MKDIR_P) $(dir $@) - $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - $@ + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - $@ src/shared/af-to-name.h: src/shared/af-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ +src/shared/arphrd-list.txt: + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include net/if_arp.h - $@ + +src/shared/arphrd-to-name.h: src/shared/arphrd-list.txt + $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ + +src/shared/arphrd-from-name.gperf: src/shared/arphrd-list.txt + $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@ + src/resolve/dns_type-list.txt: src/resolve/dns-type.h $(AM_V_at)$(MKDIR_P) $(dir $@) @@ -4974,6 +4992,18 @@ systemd_networkd_wait_online_LDADD = \ libsystemd-internal.la \ libsystemd-shared.la +rootbin_PROGRAMS += \ + networkctl + +networkctl_SOURCES = \ + src/network/networkctl.c + +networkctl_LDADD = \ + libsystemd-internal.la \ + libudev-internal.la \ + libsystemd-shared.la \ + libsystemd-network.la + test_network_SOURCES = \ src/network/test-network.c -- cgit v1.2.3-54-g00ecf