aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-11-02 16:38:44 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-11-02 16:38:44 +0100
commit73ede020c76126e81325fcd8d3e186132db21198 (patch)
tree24850bdbecced0aff461000f9fc545c8576d1e72 /src/main.c
parent0ef067ee3c394a296a8e091e8b365e29036df085 (diff)
downloaddns-73ede020c76126e81325fcd8d3e186132db21198.tar.gz
Added fqdn to qname
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 1dcd0f4..120637d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,8 +28,35 @@ void signal_term ( );
void signal_term_child ( );
+int test_main( int argc,
+ char* argv[] )
+{
+ printf("TEST MODE. NOT FUNCTIONAL\n");
+
+ char in[128];
+ char out[128];
+
+ strncpy ( in, "www.example.com\0", 127);
+
+ printf("%s\n", in);
+
+ int written = fqdn_to_qname (in,128,out,128);
+
+ if (written < 0) {
+ printf("invallid fqdn\n");
+ return 1;
+ }
+
+ for(int i = 0; i < written; i++)
+ printf(" %x ", out[i]);
+
+ printf("\n\n");
+ return 0;
+}
+
int main( int argc,
- char* argv[] ) {
+ char* argv[] )
+{
int ret;
struct sockaddr_in sock_server_addr;