summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-17 12:45:31 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-17 12:45:31 +0100
commit5031c4e21b4379c1824033be675517978090fd36 (patch)
treee94470c3ec72b4b98b07482cba22dc556ed3c55e /src/basic
parent2c45295e47642812ea417efba7f2f3339c6e2912 (diff)
parent5259c0559c8c0fe6ec54ac20f452fd7d106188c3 (diff)
Merge pull request #2640 from keszybz/dnssec-work-3
resolve: dumping of binary packets
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/af-list.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/basic/af-list.h b/src/basic/af-list.h
index 135248dc64..6a4cc03839 100644
--- a/src/basic/af-list.h
+++ b/src/basic/af-list.h
@@ -19,7 +19,23 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "string-util.h"
+
const char *af_to_name(int id);
int af_from_name(const char *name);
+static inline const char* af_to_name_short(int id) {
+ const char *f;
+
+ if (id == AF_UNSPEC)
+ return "*";
+
+ f = af_to_name(id);
+ if (!f)
+ return "unknown";
+
+ assert(startswith(f, "AF_"));
+ return f + 3;
+}
+
int af_max(void);