Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Caco
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vytor Calixto
Caco
Commits
973e8f07
Commit
973e8f07
authored
9 years ago
by
Vytor Calixto
Browse files
Options
Downloads
Patches
Plain Diff
Added definitions and included socket connection
parent
2b354dad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
ConexaoRawSocket.c
+2
-0
2 additions, 0 deletions
ConexaoRawSocket.c
Makefile
+0
-1
0 additions, 1 deletion
Makefile
client.cpp
+3
-0
3 additions, 0 deletions
client.cpp
definitions.h
+13
-0
13 additions, 0 deletions
definitions.h
with
18 additions
and
1 deletion
ConexaoRawSocket.c
+
2
−
0
View file @
973e8f07
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
0
−
1
View file @
973e8f07
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
client.cpp
+
3
−
0
View file @
973e8f07
#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
;
...
...
This diff is collapsed.
Click to expand it.
definitions.h
+
13
−
0
View file @
973e8f07
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment