summaryrefslogtreecommitdiff
path: root/src/resolve/dns_type-to-name.awk
blob: 92187d5652c763af3b18304bbde252b1f41cd077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# SPDX-License-Identifier: LGPL-2.1-or-later

BEGIN{
        print "const char *dns_type_to_string(int type) {"
        print "        switch (type) {"
}
{
        printf "        case DNS_TYPE_%s: return ", $1;
        sub(/_/, "-");
        printf "\"%s\";\n", $1
}
END{
        print "        default: return NULL;"
        print "        }"
        print "}"
}