Commit d341232c authored by Alessandro Rubini's avatar Alessandro Rubini Committed by Aurelio Colosimo

include: checkpatch changes (and tabify 1588 structures)

This only applies checkpatch stuff, but I took the freedom to
add tabs to the stuctures in ieee1588_types.h, to make them more
readable.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 8ee159a4
...@@ -18,11 +18,11 @@ extern void pp_diag_error(struct pp_instance *ppi, int err); ...@@ -18,11 +18,11 @@ extern void pp_diag_error(struct pp_instance *ppi, int err);
extern void pp_diag_error_str2(struct pp_instance *ppi, char *s1, char *s2); extern void pp_diag_error_str2(struct pp_instance *ppi, char *s1, char *s2);
extern void pp_diag_fatal(struct pp_instance *ppi, char *s1, char *s2); extern void pp_diag_fatal(struct pp_instance *ppi, char *s1, char *s2);
extern void pp_diag_printf(struct pp_instance *ppi, char *fmt, ...) extern void pp_diag_printf(struct pp_instance *ppi, char *fmt, ...)
__attribute__((format(printf,2,3))); __attribute__((format(printf, 2, 3)));
/* Our printf, that is implemented internally */ /* Our printf, that is implemented internally */
extern int pp_printf(const char *fmt, ...) extern int pp_printf(const char *fmt, ...)
__attribute__((format(printf,1,2))); __attribute__((format(printf, 1, 2)));
extern int pp_vsprintf(char *buf, const char *, va_list) extern int pp_vsprintf(char *buf, const char *, va_list)
__attribute__ ((format (printf, 2, 0))); __attribute__ ((format (printf, 2, 0)));
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <stdint.h> #include <stdint.h>
typedef enum {FALSE=0, TRUE} Boolean; /* FIXME really needed? */ typedef enum {FALSE=0, TRUE} Boolean; /* FIXME really needed? */
typedef uint8_t Octet; typedef uint8_t Octet;
typedef int8_t Integer8; typedef int8_t Integer8;
...@@ -62,7 +61,7 @@ typedef struct { ...@@ -62,7 +61,7 @@ typedef struct {
typedef struct { typedef struct {
Enumeration16 networkProtocol; Enumeration16 networkProtocol;
UInteger16 adressLength; UInteger16 adressLength;
Octet* adressField; Octet *adressField;
} PortAdress; } PortAdress;
typedef struct { typedef struct {
...@@ -74,12 +73,12 @@ typedef struct { ...@@ -74,12 +73,12 @@ typedef struct {
typedef struct { typedef struct {
Enumeration16 tlvType; Enumeration16 tlvType;
UInteger16 lengthField; UInteger16 lengthField;
Octet* valueField; Octet *valueField;
} TLV; } TLV;
typedef struct { typedef struct {
UInteger8 lengthField; UInteger8 lengthField;
Octet* textField; Octet *textField;
} PTPText; } PTPText;
typedef struct { typedef struct {
...@@ -162,7 +161,7 @@ typedef struct { ...@@ -162,7 +161,7 @@ typedef struct {
/* Signaling Message (table 33, page 133) */ /* Signaling Message (table 33, page 133) */
typedef struct { typedef struct {
PortIdentity targetPortIdentity; PortIdentity targetPortIdentity;
char* tlv; char *tlv;
} MsgSignaling; } MsgSignaling;
/* Management Message (table 37, page 137) */ /* Management Message (table 37, page 137) */
...@@ -171,7 +170,7 @@ typedef struct { ...@@ -171,7 +170,7 @@ typedef struct {
UInteger8 startingBoundaryHops; UInteger8 startingBoundaryHops;
UInteger8 boundaryHops; UInteger8 boundaryHops;
Enumeration4 actionField; Enumeration4 actionField;
char* tlv; char *tlv;
} MsgManagement; } MsgManagement;
...@@ -288,7 +287,7 @@ enum ENNetworkProtocol { ...@@ -288,7 +287,7 @@ enum ENNetworkProtocol {
}; };
/* Enumeration Time Source (table 7, page 57) */ /* Enumeration Time Source (table 7, page 57) */
enum ENTimeSource{ enum ENTimeSource {
ATOMIC_CLOCK = 0x10, ATOMIC_CLOCK = 0x10,
GPS = 0x20, GPS = 0x20,
TERRESTRIAL_RADIO = 0x30, TERRESTRIAL_RADIO = 0x30,
......
...@@ -50,14 +50,12 @@ struct pp_runtime_opts { ...@@ -50,14 +50,12 @@ struct pp_runtime_opts {
* char *file; [PP_PATH_MAX] * char *file; [PP_PATH_MAX]
*/ */
}; };
extern struct pp_runtime_opts default_rt_opts; /* preinitialized extern struct pp_runtime_opts default_rt_opts; /* preinited with defaults */
* with default values */
/* /*
* Communication channel * Communication channel
*/ */
struct pp_channel struct pp_channel {
{
union { union {
int fd; /* Posix wants fid descriptor */ int fd; /* Posix wants fid descriptor */
void *custom; /* Other archs want other stuff */ void *custom; /* Other archs want other stuff */
...@@ -71,8 +69,7 @@ struct pp_channel ...@@ -71,8 +69,7 @@ struct pp_channel
/* /*
* Foreign master record. Used to manage Foreign masters * Foreign master record. Used to manage Foreign masters
*/ */
struct pp_frgn_master struct pp_frgn_master {
{
PortIdentity port_identity; PortIdentity port_identity;
UInteger16 ann_messages; UInteger16 ann_messages;
...@@ -84,8 +81,7 @@ struct pp_frgn_master ...@@ -84,8 +81,7 @@ struct pp_frgn_master
/* /*
* Timer * Timer
*/ */
struct pp_timer struct pp_timer {
{
uint32_t start; uint32_t start;
uint32_t interval; uint32_t interval;
}; };
...@@ -93,8 +89,7 @@ struct pp_timer ...@@ -93,8 +89,7 @@ struct pp_timer
/* /*
* Net Path * Net Path
*/ */
struct pp_net_path struct pp_net_path {
{
struct pp_channel evt_ch; struct pp_channel evt_ch;
struct pp_channel gen_ch; struct pp_channel gen_ch;
Integer32 ucast_addr; Integer32 ucast_addr;
...@@ -167,11 +162,11 @@ struct pp_instance { ...@@ -167,11 +162,11 @@ struct pp_instance {
waiting_for_follow:1; waiting_for_follow:1;
}; };
#define DSDEF(x) x->defaultDS #define DSDEF(x) ((x)->defaultDS)
#define DSCUR(x) x->currentDS #define DSCUR(x) ((x)->currentDS)
#define DSPAR(x) x->parentDS #define DSPAR(x) ((x)->parentDS)
#define DSPOR(x) x->portDS #define DSPOR(x) ((x)->portDS)
#define DSPRO(x) x->timePropertiesDS #define DSPRO(x) ((x)->timePropertiesDS)
/* The channel for an instance must be created and possibly destroyed. */ /* The channel for an instance must be created and possibly destroyed. */
...@@ -234,7 +229,7 @@ extern void msg_pack_pdelay_resp(void *buf, MsgHeader *hdr, ...@@ -234,7 +229,7 @@ extern void msg_pack_pdelay_resp(void *buf, MsgHeader *hdr,
Timestamp *req_rec_tstamp, struct pp_instance *ppi); Timestamp *req_rec_tstamp, struct pp_instance *ppi);
extern void msg_unpack_pdelay_resp(void *buf, MsgPDelayResp *presp); extern void msg_unpack_pdelay_resp(void *buf, MsgPDelayResp *presp);
extern void msg_pack_pdelay_resp_followup(void *buf, MsgHeader *hdr, extern void msg_pack_pdelay_resp_followup(void *buf, MsgHeader *hdr,
Timestamp *resp_orig_tstamp, struct pp_instance* ppi); Timestamp *resp_orig_tstamp, struct pp_instance *ppi);
extern void msg_unpack_pdelay_resp_followup(void *buf, extern void msg_unpack_pdelay_resp_followup(void *buf,
MsgPDelayRespFollowUp *presp_follow); MsgPDelayRespFollowUp *presp_follow);
......
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