diff options
Diffstat (limited to '')
-rw-r--r-- | plugins/epan/ethercat/packet-ecatmb.h | 258 |
1 files changed, 129 insertions, 129 deletions
diff --git a/plugins/epan/ethercat/packet-ecatmb.h b/plugins/epan/ethercat/packet-ecatmb.h index 54dce708..6e9ad29b 100644 --- a/plugins/epan/ethercat/packet-ecatmb.h +++ b/plugins/epan/ethercat/packet-ecatmb.h @@ -18,7 +18,7 @@ DIAG_OFF_PEDANTIC typedef struct TETHERNET_ADDRESS { - guint8 b[6]; + uint8_t b[6]; } ETHERNET_ADDRESS, *PETHERNET_ADDRESS; #define ETHERNET_ADDRESS_LEN ((int) sizeof(ETHERNET_ADDRESS)) @@ -31,21 +31,21 @@ typedef struct TETHERNET_ADDRESS typedef union tMbxHeaderControlUnion { - guint16 Control; + uint16_t Control; struct { - guint16 Channel : 6; /* optional communication channels (default = 0)*/ - guint16 Priority : 2; /* optional communication priority (default = 0)*/ - guint16 Type : 4; /* TETHERCAT_MBOX_TYPE_xxx*/ - guint16 Counter : 3; /* 0 = counter not used (old version)*/ - guint16 Unsupported : 1; /* unsupported protocol detected*/ + uint16_t Channel : 6; /* optional communication channels (default = 0)*/ + uint16_t Priority : 2; /* optional communication priority (default = 0)*/ + uint16_t Type : 4; /* TETHERCAT_MBOX_TYPE_xxx*/ + uint16_t Counter : 3; /* 0 = counter not used (old version)*/ + uint16_t Unsupported : 1; /* unsupported protocol detected*/ } v; } MbxHeaderControlUnion; typedef struct TETHERCAT_MBOX_HEADER { - guint16 Length; /* following bytes*/ - guint16 Address; /* S->M: phys addr of destination; M->S: phys addr of source; 0 = master*/ + uint16_t Length; /* following bytes*/ + uint16_t Address; /* S->M: phys addr of destination; M->S: phys addr of source; 0 = master*/ MbxHeaderControlUnion aControlUnion; } ETHERCAT_MBOX_HEADER, *PETHERCAT_MBOX_HEADER; @@ -70,18 +70,18 @@ typedef struct TETHERCAT_MBOX_HEADER /*typedef struct TETHERCAT_EOE_INIT { - guint32 ContainsMacAddr :1; - guint32 ContainsIpAddr :1; - guint32 ContainsSubnetMask :1; - guint32 ContainsDefaultGateway :1; - guint32 ContainsDnsServer :1; - guint32 ContainsDnsName :1; - guint32 Reserved :26; + uint32_t ContainsMacAddr :1; + uint32_t ContainsIpAddr :1; + uint32_t ContainsSubnetMask :1; + uint32_t ContainsDefaultGateway :1; + uint32_t ContainsDnsServer :1; + uint32_t ContainsDnsName :1; + uint32_t Reserved :26; ETHERNET_ADDRESS MacAddr; - guint32 IpAddr; - guint32 SubnetMask; - guint32 DefaultGateway; - guint32 DnsServer; + uint32_t IpAddr; + uint32_t SubnetMask; + uint32_t DefaultGateway; + uint32_t DnsServer; char DnsName[32]; } ETHERCAT_EOE_INIT, *PETHERCAT_EOE_INIT;*/ #define ETHERCAT_EOE_INIT_LEN 58 /*sizeof(ETHERCAT_EOE_INIT)*/ @@ -90,13 +90,13 @@ typedef union tEoeMacFilterOptionsUnion { struct { - guint16 MacFilterCount :4; - guint16 MacFilterMaskCount :2; - guint16 Reserved1 :1; - guint16 NoBroadcasts :1; - guint16 Reserved2 :8; + uint16_t MacFilterCount :4; + uint16_t MacFilterMaskCount :2; + uint16_t Reserved1 :1; + uint16_t NoBroadcasts :1; + uint16_t Reserved2 :8; } v; - guint16 Options; + uint16_t Options; } EoeMacFilterOptionsUnion; typedef struct TETHERCAT_EOE_MACFILTER @@ -109,7 +109,7 @@ typedef struct TETHERCAT_EOE_MACFILTER typedef struct TETHERCAT_EOE_TIMESTAMP { - guint32 TimeStamp; /* 32 bit time stamp */ + uint32_t TimeStamp; /* 32 bit time stamp */ } ETHERCAT_EOE_TIMESTAMP; #define ETHERCAT_EOE_TIMESTAMP_LEN ((int) sizeof(ETHERCAT_EOE_TIMESTAMP)) @@ -117,26 +117,26 @@ typedef union tEoeHeaderDataUnion { struct { /* EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only */ - guint16 Fragment : 6; /* fragment number (EOE_TYPE_FRAME_FRAG only) */ - guint16 OffsetBuffer : 6; /* byte offset multiplied by 32 (if Fragment != 0) (EOE_TYPE_FRAME_FRAG only) */ + uint16_t Fragment : 6; /* fragment number (EOE_TYPE_FRAME_FRAG only) */ + uint16_t OffsetBuffer : 6; /* byte offset multiplied by 32 (if Fragment != 0) (EOE_TYPE_FRAME_FRAG only) */ /* buffer size multiplied by 32 (if Fragment == 0) (EOE_TYPE_FRAME_FRAG only) */ - guint16 FrameNo : 4; /* frame number (EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only) */ + uint16_t FrameNo : 4; /* frame number (EOE_TYPE_FRAME_FRAG and EOE_TYPE_TIMESTAMP_RES only) */ } v; - guint16 Result; /* EOE_TYPE_INIT_RES and EOE_TYPE_MACFILTER_RES only */ + uint16_t Result; /* EOE_TYPE_INIT_RES and EOE_TYPE_MACFILTER_RES only */ } EoeHeaderDataUnion; typedef union tEoeHeaderInfoUnion { struct { - guint16 Type : 4; /* specifies following data */ - guint16 PortAssign : 4; /* 0 = unspecified, 1 = port 1 */ - guint16 LastFragment : 1; /* TRUE if last fragment (EOE_TYPE_FRAME_FRAG only) */ - guint16 TimeStampAppended : 1; /* 32 bit time stamp appended (EOE_TYPE_FRAME_FRAG with LastFragment=1 only) */ - guint16 TimeStampRequested : 1; /* time stamp response requested (EOE_TYPE_FRAME_FRAG only) */ - guint16 Reserved : 5; + uint16_t Type : 4; /* specifies following data */ + uint16_t PortAssign : 4; /* 0 = unspecified, 1 = port 1 */ + uint16_t LastFragment : 1; /* true if last fragment (EOE_TYPE_FRAME_FRAG only) */ + uint16_t TimeStampAppended : 1; /* 32 bit time stamp appended (EOE_TYPE_FRAME_FRAG with LastFragment=1 only) */ + uint16_t TimeStampRequested : 1; /* time stamp response requested (EOE_TYPE_FRAME_FRAG only) */ + uint16_t Reserved : 5; } v; - guint16 Info; + uint16_t Info; } EoeHeaderInfoUnion; typedef struct TETHERCAT_EOE_HEADER @@ -160,11 +160,11 @@ typedef union TETHERCAT_COE_HEADER { struct { - guint16 Number : 9; /* e.g. PDO number*/ - guint16 Reserved : 3; /* = 0*/ - guint16 Type : 4; /* CANopen type*/ + uint16_t Number : 9; /* e.g. PDO number*/ + uint16_t Reserved : 3; /* = 0*/ + uint16_t Type : 4; /* CANopen type*/ } v; - guint16 header; + uint16_t header; } ETHERCAT_COE_HEADER, *PETHERCAT_COE_HEADER; #define ETHERCAT_COE_HEADER_LEN ((int) sizeof(ETHERCAT_COE_HEADER)) @@ -173,72 +173,72 @@ typedef union tSdoHeaderUnion { struct { /* Initiate Download Request*/ - guint8 SizeInd : 1; - guint8 Expedited : 1; - guint8 Size : 2; - guint8 Complete : 1; - guint8 Ccs : 3; /* = 1*/ + uint8_t SizeInd : 1; + uint8_t Expedited : 1; + uint8_t Size : 2; + uint8_t Complete : 1; + uint8_t Ccs : 3; /* = 1*/ } Idq; struct { /* Initiate Download Response*/ - guint8 Reserved : 5; - guint8 Scs : 3; /* = 3*/ + uint8_t Reserved : 5; + uint8_t Scs : 3; /* = 3*/ } Ids; struct { /* Download Segment Request*/ - guint8 LastSeg : 1; - guint8 Size : 3; - guint8 Toggle : 1; - guint8 Ccs : 3; /* = 0*/ + uint8_t LastSeg : 1; + uint8_t Size : 3; + uint8_t Toggle : 1; + uint8_t Ccs : 3; /* = 0*/ } Dsq; struct { /* Download Segment Response*/ - guint8 Reserved : 4; - guint8 Toggle : 1; - guint8 Scs : 3; /* = 1*/ + uint8_t Reserved : 4; + uint8_t Toggle : 1; + uint8_t Scs : 3; /* = 1*/ } Dss; struct { /* Initiate Upload Request*/ - guint8 Reserved : 4; - guint8 Complete : 1; - guint8 Ccs : 3; /* = 2*/ + uint8_t Reserved : 4; + uint8_t Complete : 1; + uint8_t Ccs : 3; /* = 2*/ } Iuq; struct { /* Initiate Upload Response*/ - guint8 SizeInd : 1; - guint8 Expedited : 1; - guint8 Size : 2; - guint8 Complete : 1; - guint8 Scs : 3; /* = 2*/ + uint8_t SizeInd : 1; + uint8_t Expedited : 1; + uint8_t Size : 2; + uint8_t Complete : 1; + uint8_t Scs : 3; /* = 2*/ } Ius; struct { /* Upload Segment Request*/ - guint8 Reserved : 4; - guint8 Toggle : 1; - guint8 Ccs : 3; /* = 3*/ + uint8_t Reserved : 4; + uint8_t Toggle : 1; + uint8_t Ccs : 3; /* = 3*/ } Usq; struct { /* Upload Segment Response*/ - guint8 LastSeg : 1; - guint8 Bytes : 3; - guint8 Toggle : 1; - guint8 Scs : 3; /* = 0*/ + uint8_t LastSeg : 1; + uint8_t Bytes : 3; + uint8_t Toggle : 1; + uint8_t Scs : 3; /* = 0*/ } Uss; struct { /* Abort Transfer*/ - guint8 Reserved : 5; - guint8 Ccs : 3; /* = 4*/ + uint8_t Reserved : 5; + uint8_t Ccs : 3; /* = 4*/ } Abt; - guint8 CS; + uint8_t CS; } SdoHeaderUnion; typedef struct TETHERCAT_SDO_HEADER { SdoHeaderUnion anSdoHeaderUnion; - guint16 Index; - guint8 SubIndex; - guint32 Data; + uint16_t Index; + uint8_t SubIndex; + uint32_t Data; } ETHERCAT_SDO_HEADER, *PETHERCAT_SDO_HEADER; #define ETHERCAT_SDO_HEADER_LEN 8 /* sizeof(ETHERCAT_SDO_HEADER)*/ @@ -284,42 +284,42 @@ typedef struct TETHERCAT_SDO_HEADER typedef struct TETHERCAT_SDO_INFO_LIST { - guint16 ListType; /* == SDO_INFO_LIST_TYPE_XXX */ + uint16_t ListType; /* == SDO_INFO_LIST_TYPE_XXX */ struct { - guint16 Index[1]; + uint16_t Index[1]; } Res; } ETHERCAT_SDO_INFO_LIST; typedef struct TETHERCAT_SDO_INFO_OBJ { - guint16 Index; + uint16_t Index; struct { - guint16 DataType; /* refer to data type index */ - guint8 MaxSubIndex; /* max subIndex */ - guint8 ObjCode; /* defined in DS 301 (Table 37)*/ + uint16_t DataType; /* refer to data type index */ + uint8_t MaxSubIndex; /* max subIndex */ + uint8_t ObjCode; /* defined in DS 301 (Table 37)*/ char Name[1]; /* rest of mailbox data*/ } Res; } ETHERCAT_SDO_INFO_OBJ; typedef struct TETHERCAT_SDO_INFO_ENTRY { - guint16 Index; - guint8 SubIdx; - guint8 ValueInfo; /* bit0 = ObjAccess, bit1 = ObjCategory, bit2 = PdoMapping, bit3 = UnitType + uint16_t Index; + uint8_t SubIdx; + uint8_t ValueInfo; /* bit0 = ObjAccess, bit1 = ObjCategory, bit2 = PdoMapping, bit3 = UnitType bit4 = DefaultValue, bit5 = MinValue, bit6 = MaxValue*/ struct { - guint16 DataType; /* refer to data type index */ - guint16 BitLen; - guint16 ObjAccess; /* bit0 = read; bit1 = write; bit2 = const. bit3 = 'PRE-OP'; bit4 = 'SAFE-OP'; bit5 = 'OP'.*/ + uint16_t DataType; /* refer to data type index */ + uint16_t BitLen; + uint16_t ObjAccess; /* bit0 = read; bit1 = write; bit2 = const. bit3 = 'PRE-OP'; bit4 = 'SAFE-OP'; bit5 = 'OP'.*/ } Res; } ETHERCAT_SDO_INFO_ENTRY; typedef struct TETHERCAT_SDO_INFO_ERROR { - guint32 ErrorCode; + uint32_t ErrorCode; char ErrorText[1]; /* rest of mailbox data */ } ETHERCAT_SDO_INFO_ERROR; @@ -329,24 +329,24 @@ typedef union tSdoInfoUnion ETHERCAT_SDO_INFO_OBJ Obj; ETHERCAT_SDO_INFO_ENTRY Entry; ETHERCAT_SDO_INFO_ERROR Error; - guint8 Data[1]; + uint8_t Data[1]; } SdoInfoUnion; typedef union tSdoControlUnion { struct { - guint8 OpCode : 7; /* == SDO_INFO_TYPE_XXX */ - guint8 InComplete : 1; + uint8_t OpCode : 7; /* == SDO_INFO_TYPE_XXX */ + uint8_t InComplete : 1; } v; - guint8 Control; + uint8_t Control; } SdoControlUnion; typedef struct TETHERCAT_SDO_INFO_HEADER { SdoControlUnion anSdoControlUnion; - guint8 Reserved; /* == 0 */ - guint16 FragmentsLeft; + uint8_t Reserved; /* == 0 */ + uint16_t FragmentsLeft; SdoInfoUnion anSdoInfoUnion; } ETHERCAT_SDO_INFO_HEADER, *PETHERCAT_SDO_INFO_HEADER; @@ -373,30 +373,30 @@ typedef struct TETHERCAT_SDO_INFO_HEADER typedef union tFoeHeaderDataUnion { - guint32 FileLength; /* (RRQ, WRQ) = 0 if unknown */ + uint32_t FileLength; /* (RRQ, WRQ) = 0 if unknown */ struct { - guint16 PacketNo; /* (DATA, ACK)*/ - guint16 Reserved2; /* (DATA, ACK)*/ + uint16_t PacketNo; /* (DATA, ACK)*/ + uint16_t Reserved2; /* (DATA, ACK)*/ } v; - guint32 ErrorCode; /* (ERR)*/ + uint32_t ErrorCode; /* (ERR)*/ struct { - guint16 Done; /* (BUSY)*/ - guint16 Entire; /* (BUSY)*/ + uint16_t Done; /* (BUSY)*/ + uint16_t Entire; /* (BUSY)*/ } v2; } FoeHeaderDataUnion; typedef struct TETHERCAT_FOE_HEADER { - guint8 OpMode; /* = 1 (RRQ), = 2 (WRQ), = 3 (DATA), = 4 (ACK), = 5 (ERR), = 6 (BUSY) */ - guint8 Reserved1; /* = 0 */ + uint8_t OpMode; /* = 1 (RRQ), = 2 (WRQ), = 3 (DATA), = 4 (ACK), = 5 (ERR), = 6 (BUSY) */ + uint8_t Reserved1; /* = 0 */ FoeHeaderDataUnion aFoeHeaderDataUnion; /* typedef union tMailBoxDataUnion { char Name[] (RRQ, WRQ) rest of mailbox data - guint8 Data[] (DATA) rest of mailbox data (if OpMode = 3) + uint8_t Data[] (DATA) rest of mailbox data (if OpMode = 3) char ErrorText[] (ERR) rest of mailbox data } MailBoxDataUnion;*/ } ETHERCAT_FOE_HEADER, *PETHERCAT_FOE_HEADER; @@ -404,10 +404,10 @@ typedef struct TETHERCAT_FOE_HEADER typedef struct { - guint16 Cmd; - guint16 Size; - guint16 AddressLW; - guint16 AddressHW; + uint16_t Cmd; + uint16_t Size; + uint16_t AddressLW; + uint16_t AddressHW; } TEFWUPDATE_HEADER; @@ -423,32 +423,32 @@ typedef union tSoeHeaderControlUnion { struct { - guint8 OpCode : 3; /* 0 = unused, 1 = readReq, 2 = readRes, 3 = writeReq, 4 = writeRes + uint8_t OpCode : 3; /* 0 = unused, 1 = readReq, 2 = readRes, 3 = writeReq, 4 = writeRes 5 = notification (command changed notification)*/ - guint8 InComplete : 1; /* more follows*/ - guint8 Error : 1; /* an error word follows */ - guint8 DriveNo : 3; /* drive number */ - - guint8 DataState : 1; /* follows or requested */ - guint8 Name : 1; /* follows or requested */ - guint8 Attribute : 1; /* follows or requested */ - guint8 Unit : 1; /* follows or requested */ - guint8 Min : 1; /* follows or requested */ - guint8 Max : 1; /* follows or requested */ - guint8 Value : 1; /* follows or requested */ - guint8 Reserved : 1; + uint8_t InComplete : 1; /* more follows*/ + uint8_t Error : 1; /* an error word follows */ + uint8_t DriveNo : 3; /* drive number */ + + uint8_t DataState : 1; /* follows or requested */ + uint8_t Name : 1; /* follows or requested */ + uint8_t Attribute : 1; /* follows or requested */ + uint8_t Unit : 1; /* follows or requested */ + uint8_t Min : 1; /* follows or requested */ + uint8_t Max : 1; /* follows or requested */ + uint8_t Value : 1; /* follows or requested */ + uint8_t Reserved : 1; } v; struct { - guint8 Control; - guint8 Element; + uint8_t Control; + uint8_t Element; } v2; } SoeHeaderControlUnion; typedef union tSoeHeaderDataUnion { - guint16 IDN; /* SOE IDN if (InComplete==0) */ - guint16 FragmentsLeft; /* Pending fragments if (InComplete==1) */ + uint16_t IDN; /* SOE IDN if (InComplete==0) */ + uint16_t FragmentsLeft; /* Pending fragments if (InComplete==1) */ } SoeHeaderDataUnion; typedef struct TETHERCAT_SOE_HEADER @@ -457,13 +457,13 @@ typedef struct TETHERCAT_SOE_HEADER SoeHeaderDataUnion anSoeHeaderDataUnion; /* typedef union tMailBoxDataUnion { - guint8 Data[] rest of mailbox data if (Error==0) - guint16 ErrorCode if (Error==1) + uint8_t Data[] rest of mailbox data if (Error==0) + uint16_t ErrorCode if (Error==1) } MailBoxDataUnion;*/ } ETHERCAT_SOE_HEADER, *PETHERCAT_SOE_HEADER; #define ETHERCAT_SOE_HEADER_LEN ((int) sizeof(ETHERCAT_SOE_HEADER)) -extern void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset); +extern void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, int offset); DIAG_ON_PEDANTIC #endif /* _PACKET_ECATMAILBOX_H_ */ |