examples/portscanner: quick hack to make it work on single host/portrange
[rofl0r-rocksock.git] / rocksock_strerror_type.c
blob880048e86ecec1f55155f5814aaea83d2cdcc3ee
1 #include "rocksock.h"
2 static const char rs_errortype_map[][9] = {
3 [ RS_ET_OWN ] = "rocksock",
4 [ RS_ET_SYS ] = "system",
5 [ RS_ET_GAI ] = "gai/dns",
6 [ RS_ET_SSL ] = "ssl",
7 };
9 const char* rocksock_strerror_type(rocksock *sock) {
10 if(sock->lasterror.errortype < RS_ET_MAX)
11 return rs_errortype_map[sock->lasterror.errortype];
12 return 0;