Skip to content
Snippets Groups Projects
Commit 973e8f07 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Added definitions and included socket connection

parent 2b354dad
Branches
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int ConexaoRawSocket(char *device) int ConexaoRawSocket(char *device)
......
...@@ -3,7 +3,6 @@ CC=g++ ...@@ -3,7 +3,6 @@ CC=g++
OBJ=Protocol.o OBJ=Protocol.o
%.o: %.cpp %.o: %.cpp
$(CC) $(CFLAGS) $^ -c -o $@ $(CC) $(CFLAGS) $^ -c -o $@
cacoclient: client.cpp $(OBJ) cacoclient: client.cpp $(OBJ)
......
#include "definitions.h" #include "definitions.h"
#include "dirFunctions.h" #include "dirFunctions.h"
#include "ConexaoRawSocket.c"
int main(){ int main(){
int socket = ConexaoRawSocket(DEVICE);
while(true){ while(true){
string command, path; string command, path;
cout << endl << "Entre com o comando:" << endl; cout << endl << "Entre com o comando:" << endl;
......
...@@ -7,6 +7,19 @@ ...@@ -7,6 +7,19 @@
using namespace std; using namespace std;
#define DEVICE "lo"
#define NACK 0
#define ACK 1
#define CD 3
#define LS 4
#define PUT 5
#define GET 6
#define OK 8
#define TAM 9
#define TELA 10
#define ERRO 14
#define FIM 15
typedef struct { typedef struct {
int begin : 8, int begin : 8,
size : 6, size : 6,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment