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
7646a3a0
Commit
7646a3a0
authored
Dec 05, 2011
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused stuff and too verbose comments
parent
13966f1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
32 deletions
+5
-32
pproto.h
include/pproto/pproto.h
+5
-32
No files found.
include/pproto/pproto.h
View file @
7646a3a0
...
@@ -11,33 +11,17 @@
...
@@ -11,33 +11,17 @@
/*
/*
* This is the struct handling runtime options. Default values can be
* Runtime options. Default values can be overridden by command line.
* overridden by command line
*/
*/
struct
pp_runtime_opts
{
struct
pp_runtime_opts
{
/* TODO */
/* TODO */
};
};
struct
pp_net_path
{
union
{
int
evt_sock
;
void
*
custom
;
};
int32_t
gen_sock
;
int32_t
mcast_addr
;
int32_t
peer_mcast_addr
;
int32_t
ucast_addr
;
};
extern
struct
pp_runtime_opts
default_rt_opts
;
/* preinitialized
extern
struct
pp_runtime_opts
default_rt_opts
;
/* preinitialized
* with default values */
* with default values */
/*
/*
* This is the communication channel. Either a socket (Posix stuff)
* Communication channel
* or another implementation-specific thin, possibly allocated.
* For consistency, this is a struct not a union. gcc allows unnamed
* unions as structure fields, and we are gcc-specific anyways.
*/
*/
struct
pp_channel
{
struct
pp_channel
{
union
{
union
{
...
@@ -50,10 +34,7 @@ struct pp_channel {
...
@@ -50,10 +34,7 @@ struct pp_channel {
};
};
/*
/*
* This is the structure for the standard protocol.
* Structure for the standard protocol
* Extensions may allocate a bigger structure that includes this one.
* The encompassing structure will be at the same address, or container_of()
* may be implemented and used
*/
*/
struct
pp_instance
{
struct
pp_instance
{
int
state
;
int
state
;
...
@@ -62,7 +43,6 @@ struct pp_instance {
...
@@ -62,7 +43,6 @@ struct pp_instance {
void
*
ext_data
;
/* if protocol ext needs it */
void
*
ext_data
;
/* if protocol ext needs it */
struct
pp_channel
ch
;
struct
pp_channel
ch
;
struct
pp_runtime_opts
*
rt_opts
;
struct
pp_runtime_opts
*
rt_opts
;
struct
pp_clock
*
ppc
;
/* Data sets */
/* Data sets */
DSDefault
*
defaultDS
;
DSDefault
*
defaultDS
;
...
@@ -82,7 +62,7 @@ extern int pp_close_instance(struct pp_instance *ppi);
...
@@ -82,7 +62,7 @@ extern int pp_close_instance(struct pp_instance *ppi);
extern
int
pp_parse_cmdline
(
struct
pp_instance
*
ppi
,
int
argc
,
char
**
argv
);
extern
int
pp_parse_cmdline
(
struct
pp_instance
*
ppi
,
int
argc
,
char
**
argv
);
/*
n
etwork stuff */
/*
N
etwork stuff */
extern
int
pp_net_init
(
struct
pp_instance
*
ppi
);
extern
int
pp_net_init
(
struct
pp_instance
*
ppi
);
extern
int
pp_recv_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
);
extern
int
pp_recv_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
);
extern
int
pp_send_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
);
extern
int
pp_send_packet
(
struct
pp_instance
*
ppi
,
void
*
pkt
,
int
len
);
...
@@ -94,12 +74,6 @@ extern void pp_get_stamp(uint32_t *sptr);
...
@@ -94,12 +74,6 @@ extern void pp_get_stamp(uint32_t *sptr);
/*
/*
* The state machine itself is an array of these structures.
* The state machine itself is an array of these structures.
* Each state in the machine has an array item. Both functions are
* called (one is expected to be the standard one, the other the extension).
*
* The return value is 0 or a negative error code, but functions should
* also set the fields next_state and next_delay. Processing for the next
* state is entered when a packet arrives or when the delay expires.
*/
*/
struct
pp_state_table_item
{
struct
pp_state_table_item
{
...
@@ -123,7 +97,7 @@ enum pp_std_states {
...
@@ -123,7 +97,7 @@ enum pp_std_states {
PPS_SLAVE
,
PPS_SLAVE
,
};
};
/* Use a typedef, to avoid long prototypes
-- I'm not sure I like it
*/
/* Use a typedef, to avoid long prototypes */
typedef
int
pp_action
(
struct
pp_instance
*
ppi
,
uint8_t
*
packet
,
int
plen
);
typedef
int
pp_action
(
struct
pp_instance
*
ppi
,
uint8_t
*
packet
,
int
plen
);
/* Standard state-machine functions */
/* Standard state-machine functions */
...
@@ -136,7 +110,6 @@ extern int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen);
...
@@ -136,7 +110,6 @@ extern int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen);
/*
/*
* FIXME
* FIXME
* What follows is the protocol itself. Definition of packet and such stuff.
* Whe talk raw sockets on PP_PROTO_NR.
* Whe talk raw sockets on PP_PROTO_NR.
*/
*/
#define PP_PROTO_NR 0xcccc
#define PP_PROTO_NR 0xcccc
...
...
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