From d3ff2f207a7b5c6aa2aa2164b5de69f0ecfc0b82 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 24 Jun 2020 14:01:35 +0200 Subject: [PATCH] Updated makefile --- Tcp.c | 36 ------------------------------------ Tcp.h | 18 ------------------ makefile | 6 +++--- 3 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 Tcp.c delete mode 100644 Tcp.h diff --git a/Tcp.c b/Tcp.c deleted file mode 100644 index c396726..0000000 --- a/Tcp.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "Tcp.h" - -int open_tcp(char* ip, int port) { - int sockfd = socket(AF_INET, SOCK_STREAM, 0); - - if (sockfd < 0) { - perror("ERROR opening socket"); - exit(1); - } - - struct hostent *server; - struct sockaddr_in serv_addr; - - server = gethostbyname(ip); - - if (server == NULL) { - fprintf(stderr,"ERROR, no such host\n"); - exit(0); - } - - bzero((char *) &serv_addr, sizeof(serv_addr)); - serv_addr.sin_family = AF_INET; - bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); - serv_addr.sin_port = htons(port); - - if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) { - perror("ERROR connecting"); - exit(1); - } - - return sockfd; -} - -int close_tcp(int fd) { - return close(fd); -} \ No newline at end of file diff --git a/Tcp.h b/Tcp.h deleted file mode 100644 index 9649168..0000000 --- a/Tcp.h +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "Constants.h" - -#include -#include -#include -#include -#include - -int open_tcp(char* ip, int port); -int close_tcp(int fd); \ No newline at end of file diff --git a/makefile b/makefile index df99f54..677cd0d 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ .PHONY: all clean install uninstall tncattach compiler = gcc -flags = -std=gnu11 -static-libgcc +flags = -Wall -std=gnu11 -static-libgcc all: tncattach rebuild: clean all @@ -14,7 +14,7 @@ clean: tncattach: @echo "Making tncattach..." @echo "Compiling with: ${compiler}" - ${compiler} ${flags} tncattach.c Serial.c Tcp.c KISS.c TAP.c -o tncattach -Wall + ${compiler} ${flags} tncattach.c Serial.c TCP.c KISS.c TAP.c -o tncattach -Wall install: @echo "Installing tncattach..." @@ -23,4 +23,4 @@ install: uninstall: @echo "Uninstalling tncattach" - rm /usr/local/sbin/tncattach \ No newline at end of file + rm /usr/local/sbin/tncattach