Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
6ad34b16
Commit
6ad34b16
authored
Mar 06, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
defined proto_ofst for raw handling of raw socket header in send
parent
b9e54d18
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
main-loop.c
arch-gnu-linux/main-loop.c
+4
-0
posix-socket.c
arch-gnu-linux/posix-socket.c
+8
-1
posix-startup.c
arch-gnu-linux/posix-startup.c
+0
-1
pptp.h
include/pptp/pptp.h
+3
-0
No files found.
arch-gnu-linux/main-loop.c
View file @
6ad34b16
...
...
@@ -22,6 +22,10 @@ void posix_main_loop(struct pp_instance *ppi)
set_TimeInternal
(
&
ppi
->
last_rcv_time
,
0
,
0
);
if
(
OPTS
(
ppi
)
->
ethernet_mode
)
{
NP
(
ppi
)
->
proto_ofst
=
14
;
}
/*
* The main loop here is based on select. While we are not
* doing anything else but the protocol, this allows extra stuff
...
...
arch-gnu-linux/posix-socket.c
View file @
6ad34b16
...
...
@@ -135,10 +135,14 @@ int posix_send_packet(struct pp_instance *ppi, void *pkt, int len, int chtype,
int
use_pdelay_addr
)
{
struct
sockaddr_in
addr
;
void
*
hdr
;
if
(
OPTS
(
ppi
)
->
ethernet_mode
)
{
hdr
=
PROTO_HDR
(
pkt
);
/* TODO: fill header */
/* raw sockets implementation always use gen socket */
return
send
(
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
fd
,
pkt
,
len
,
0
);
return
send
(
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
fd
,
hdr
,
len
+
NP
(
ppi
)
->
proto_ofst
,
0
);
}
/* else: UDP */
...
...
@@ -359,6 +363,9 @@ int posix_net_init(struct pp_instance *ppi)
{
int
i
;
ppi
->
buf_out
=
calloc
(
1
,
PP_PACKET_SIZE
+
NP
(
ppi
)
->
proto_ofst
);
ppi
->
buf_out
=
PROTO_PAYLOAD
(
ppi
->
buf_out
);
if
(
OPTS
(
ppi
)
->
ethernet_mode
)
{
PP_PRINTF
(
"posix_net_init IEEE 802.3
\n
"
);
...
...
arch-gnu-linux/posix-startup.c
View file @
6ad34b16
...
...
@@ -42,7 +42,6 @@ int main(int argc, char **argv)
ppi
->
timePropertiesDS
=
calloc
(
1
,
sizeof
(
*
ppi
->
timePropertiesDS
));
ppi
->
net_path
=
calloc
(
1
,
sizeof
(
*
ppi
->
net_path
));
ppi
->
servo
=
calloc
(
1
,
sizeof
(
*
ppi
->
servo
));
ppi
->
buf_out
=
calloc
(
1
,
PP_PACKET_SIZE
);
ppi
->
frgn_master
=
calloc
(
1
,
sizeof
(
*
ppi
->
frgn_master
));
ppi
->
arch_data
=
calloc
(
1
,
sizeof
(
struct
posix_arch_data
));
...
...
include/pptp/pptp.h
View file @
6ad34b16
...
...
@@ -154,7 +154,10 @@ struct pp_net_path {
/* FIXME check if useful Integer32 ucast_addr;*/
Integer32
mcast_addr
;
Integer32
peer_mcast_addr
;
int
proto_ofst
;
};
#define PROTO_HDR(x) ( (x) - NP(ppi)->proto_ofst);
#define PROTO_PAYLOAD(x) ( (x) + NP(ppi)->proto_ofst);
/*
* Structure for the standard protocol
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment