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
c773d09b
Commit
c773d09b
authored
Dec 28, 2011
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
struct timeval tv moved to posix_arch_data (is arch dependent)
parent
b41b238e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
posix-socket.c
arch-gnu-linux/posix-socket.c
+5
-3
posix-startup.c
arch-gnu-linux/posix-startup.c
+3
-2
posix.h
arch-gnu-linux/posix.h
+5
-0
pproto.h
include/pproto/pproto.h
+0
-1
No files found.
arch-gnu-linux/posix-socket.c
View file @
c773d09b
...
...
@@ -154,11 +154,13 @@ int posix_net_check_pkt(struct pp_instance *ppi, int delay_ms)
int
i
;
int
ret
=
0
;
int
maxfd
;
struct
posix_arch_data
*
arch_data
=
(
struct
posix_arch_data
*
)
ppi
->
arch_data
;
if
(
delay_ms
!=
-
1
)
{
/* Wait for a packet or for the timeout */
ppi
->
tv
.
tv_sec
=
delay_ms
/
1000
;
ppi
->
tv
.
tv_usec
=
(
delay_ms
%
1000
)
*
1000
;
arch_data
->
tv
.
tv_sec
=
delay_ms
/
1000
;
arch_data
->
tv
.
tv_usec
=
(
delay_ms
%
1000
)
*
1000
;
}
ppi
->
net_path
->
gen_ch
.
pkt_present
=
0
;
...
...
@@ -169,7 +171,7 @@ int posix_net_check_pkt(struct pp_instance *ppi, int delay_ms)
FD_ZERO
(
&
set
);
FD_SET
(
ppi
->
net_path
->
gen_ch
.
fd
,
&
set
);
FD_SET
(
ppi
->
net_path
->
evt_ch
.
fd
,
&
set
);
i
=
select
(
maxfd
+
1
,
&
set
,
NULL
,
NULL
,
&
ppi
->
tv
);
i
=
select
(
maxfd
+
1
,
&
set
,
NULL
,
NULL
,
&
arch_data
->
tv
);
if
(
i
<
0
&&
errno
!=
EINTR
)
exit
(
__LINE__
);
...
...
arch-gnu-linux/posix-startup.c
View file @
c773d09b
...
...
@@ -40,12 +40,13 @@ int main(int argc, char **argv)
ppi
->
net_path
=
calloc
(
1
,
sizeof
(
*
ppi
->
net_path
));
ppi
->
buf_out
=
calloc
(
1
,
PP_PACKET_SIZE
);
ppi
->
buf_in
=
calloc
(
1
,
PP_PACKET_SIZE
);
ppi
->
frgn_master
=
calloc
(
1
,
sizeof
(
*
ppi
->
frgn_master
));;
ppi
->
frgn_master
=
calloc
(
1
,
sizeof
(
*
ppi
->
frgn_master
));
ppi
->
arch_data
=
calloc
(
1
,
sizeof
(
struct
posix_arch_data
));
if
((
!
ppi
->
defaultDS
)
||
(
!
ppi
->
currentDS
)
||
(
!
ppi
->
parentDS
)
||
(
!
ppi
->
portDS
)
||
(
!
ppi
->
timePropertiesDS
)
||
(
!
ppi
->
sent_seq_id
)
||
(
!
ppi
->
net_path
)
||
(
!
ppi
->
buf_out
)
||
(
!
ppi
->
buf_in
)
||
(
!
ppi
->
frgn_master
)
||
(
!
ppi
->
frgn_master
)
||
(
!
ppi
->
arch_data
)
)
exit
(
__LINE__
);
...
...
arch-gnu-linux/posix.h
View file @
c773d09b
...
...
@@ -6,6 +6,11 @@
* These are the functions provided by the various posix files
*/
struct
posix_arch_data
{
struct
timeval
tv
;
};
extern
int
posix_net_init
(
struct
pp_instance
*
ppi
);
extern
int
posix_net_check_pkt
(
struct
pp_instance
*
ppi
,
int
delay_ms
);
...
...
include/pproto/pproto.h
View file @
c773d09b
...
...
@@ -111,7 +111,6 @@ struct pp_instance {
void
*
ext_data
;
/* if protocol ext needs it */
struct
pp_runtime_opts
*
rt_opts
;
struct
pp_net_path
*
net_path
;
struct
timeval
tv
;
/* Data sets */
DSDefault
*
defaultDS
;
...
...
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