Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 1 | #include <string.h> |
| 2 | #include <stdio.h> |
| 3 | #include <netdb.h> |
| 4 | |
| 5 | const char *githstrerror(int err) |
| 6 | { |
| 7 | static char buffer[48]; |
| 8 | switch (err) |
| 9 | { |
| 10 | case HOST_NOT_FOUND: |
| 11 | return "Authoritative answer: host not found"; |
| 12 | case NO_DATA: |
| 13 | return "Valid name, no data record of requested type"; |
| 14 | case NO_RECOVERY: |
| 15 | return "Non recoverable errors, FORMERR, REFUSED, NOTIMP"; |
| 16 | case TRY_AGAIN: |
| 17 | return "Non-authoritative \"host not found\", or SERVERFAIL"; |
| 18 | } |
Jeff King | 48bdf86 | 2015-09-24 17:06:48 -0400 | [diff] [blame] | 19 | snprintf(buffer, sizeof(buffer), "Name resolution error %d", err); |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 20 | return buffer; |
| 21 | } |