Commit 7646a3a0 authored by Aurelio Colosimo's avatar Aurelio Colosimo

removed unused stuff and too verbose comments

parent 13966f1c
......@@ -11,33 +11,17 @@
/*
* This is the struct handling runtime options. Default values can be
* overridden by command line
* Runtime options. Default values can be overridden by command line.
*/
struct pp_runtime_opts {
/* 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
* with default values */
/*
* This is the communication channel. Either a socket (Posix stuff)
* 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.
* Communication channel
*/
struct pp_channel {
union {
......@@ -50,10 +34,7 @@ struct pp_channel {
};
/*
* This is the 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
* Structure for the standard protocol
*/
struct pp_instance {
int state;
......@@ -62,7 +43,6 @@ struct pp_instance {
void *ext_data; /* if protocol ext needs it */
struct pp_channel ch;
struct pp_runtime_opts *rt_opts;
struct pp_clock *ppc;
/* Data sets */
DSDefault *defaultDS;
......@@ -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);
/* network stuff */
/* Network stuff */
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_send_packet(struct pp_instance *ppi, void *pkt, int len);
......@@ -94,12 +74,6 @@ extern void pp_get_stamp(uint32_t *sptr);
/*
* 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 {
......@@ -123,7 +97,7 @@ enum pp_std_states {
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);
/* Standard state-machine functions */
......@@ -136,7 +110,6 @@ extern int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen);
/*
* FIXME
* What follows is the protocol itself. Definition of packet and such stuff.
* Whe talk raw sockets on PP_PROTO_NR.
*/
#define PP_PROTO_NR 0xcccc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment