OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ciptypes.h File Reference
#include "typedefs.h"
#include "networkhandler.h"
#include "enipmessage.h"
#include "opener_user_conf.h"
Include dependency graph for ciptypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cip_class
 Class is a subclass of Instance. More...
 
struct  cip_instance
 
struct  cip_service_struct
 Service descriptor. These are stored in an array. More...
 
struct  CipAttributeStruct
 
struct  CipByteArray
 CIP Byte Array. More...
 
struct  CipConnectionManagerConnectionEntryList
 
struct  CipConnectionPath
 CIP Connection Path. More...
 
struct  CipEpath
 Struct for padded EPATHs. More...
 
struct  CipMessageRouterRequest
 CIP Message Router Request. More...
 
struct  CipMessageRouterResponse
 CIP Message Router Response. More...
 
struct  CipRevision
 Struct storing the CIP revision. More...
 
struct  CipRoutePath
 
struct  CipShortString
 CIP Short String. More...
 
struct  CipString
 CIP String. More...
 
struct  CipStringN
 
struct  CipTcpIpNetworkInterfaceConfiguration
 Struct for saving TCP/IP interface information. More...
 
struct  CipUnconnectedSendParameter
 

Macros

#define MASK1(a)   ( 1 << (a) )
 
#define MASK2(a, b)   ( 1 << (a) | 1 << (b) )
 
#define MASK3(a, b, c)   ( 1 << (a) | 1 << (b) | 1 << (c) )
 
#define MASK4(a, b, c, d)   ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) )
 
#define MASK5(a, b, c, d, e)   ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) )
 
#define MASK6(a, b, c, d, e, f)   ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) | 1 << (f) )
 
#define MASK7(a, b, c, d, e, f, g)   ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) | 1 << (f) | 1 << (g) )
 
#define MASK8(a, b, c, d, e, f, g, h)
 
#define MAX_SIZE_OF_ADD_STATUS   2 /* for now we support extended status codes up to 2 16bit values there is mostly only one 16bit value used */
 

Typedefs

typedef struct cip_class CipClass
 Class is a subclass of Instance. More...
 
typedef enum cip_data_types CipDataType
 Enum containing the encoding values for CIP data types for CIP Messages. More...
 
typedef struct cip_instance CipInstance
 
typedef EipStatus(* CipServiceFunction )(CipInstance *const instance, CipMessageRouterRequest *const message_router_request, CipMessageRouterResponse *const message_router_response, struct sockaddr *originator_address, const int encapsulation_session)
 Signature definition for the implementation of CIP services. More...
 
typedef struct cip_service_struct CipServiceStruct
 Service descriptor. These are stored in an array. More...
 
typedef enum connection_point_type ConnectionPointType
 

Enumerations

enum  cip_data_types {
  kCipAny = 0x00, kCipBool = 0xC1, kCipSint = 0xC2, kCipInt = 0xC3,
  kCipDint = 0xC4, kCipLint = 0xC5, kCipUsint = 0xC6, kCipUint = 0xC7,
  kCipUdint = 0xC8, kCipUlint = 0xC9, kCipReal = 0xCA, kCipLreal = 0xCB,
  kCipStime = 0xCC, kCipDate = 0xCD, kCipTimeOfDay = 0xCE, kCipDateAndTime = 0xCF,
  kCipString = 0xD0, kCipByte = 0xD1, kCipWord = 0xD2, kCipDword = 0xD3,
  kCipLword = 0xD4, kCipString2 = 0xD5, kCipFtime = 0xD6, kCipLtime = 0xD7,
  kCipItime = 0xD8, kCipStringN = 0xD9, kCipShortString = 0xDA, kCipTime = 0xDB,
  kCipEpath = 0xDC, kCipEngUnit = 0xDD, kCipUsintUsint = 0xA0, kCipUdintUdintUdintUdintUdintString = 0xA1,
  kCip6Usint = 0xA2, kCipMemberList = 0xA3, kCipByteArray = 0xA4, kInternalUint6 = 0xF0
}
 Enum containing the encoding values for CIP data types for CIP Messages. More...
 
enum  CIPAttributeFlag {
  kNotSetOrGetable = 0x00, kGetableAll = 0x01, kGetableSingle = 0x02, kSetable = 0x04,
  kSetAndGetAble = 0x07, kGetableSingleAndAll = 0x03
}
 Definition of Get and Set Flags for CIP Attributes. More...
 
enum  CIPServiceCode {
  kGetAttributeAll = 0x01, kSetAttributeAll = 0x02, kGetAttributeList = 0x03, kSetAttributeList = 0x04,
  kReset = 0x05, kStart = 0x06, kStop = 0x07, kCreate = 0x08,
  kDelete = 0x09, kMultipleServicePacket = 0x0A, kApplyAttributes = 0x0D, kGetAttributeSingle = 0x0E,
  kSetAttributeSingle = 0x10, kFindNextObjectInstance = 0x11, kRestore = 0x15, kSave = 0x16,
  kNoOperation = 0x17, kGetMember = 0x18, kSetMember = 0x19, kInsertMember = 0x1A,
  kRemoveMember = 0x1B, kGroupSync = 0x1C, kForwardOpen = 0x54, kForwardClose = 0x4E,
  kUnconnectedSend = 0x52, kGetConnectionOwner = 0x5A
}
 Definition of CIP service codes. More...
 
enum  connection_point_type { kConnectionPointTypeProducing = 0, kConnectionPointTypeConsuming, kConnectionPointTypeConfig, kConnectionPointTypeMaxValue }
 
enum  IoConnectionEvent { kIoConnectionEventOpened, kIoConnectionEventTimedOut, kIoConnectionEventClosed }
 

Macro Definition Documentation

#define MASK1 (   a)    ( 1 << (a) )

Definition at line 327 of file ciptypes.h.

#define MASK2 (   a,
 
)    ( 1 << (a) | 1 << (b) )

Definition at line 328 of file ciptypes.h.

#define MASK3 (   a,
  b,
 
)    ( 1 << (a) | 1 << (b) | 1 << (c) )

Definition at line 329 of file ciptypes.h.

#define MASK4 (   a,
  b,
  c,
 
)    ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) )

Definition at line 330 of file ciptypes.h.

#define MASK5 (   a,
  b,
  c,
  d,
 
)    ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) )

Definition at line 331 of file ciptypes.h.

#define MASK6 (   a,
  b,
  c,
  d,
  e,
 
)    ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) | 1 << (f) )

Definition at line 333 of file ciptypes.h.

#define MASK7 (   a,
  b,
  c,
  d,
  e,
  f,
 
)    ( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) | 1 << (f) | 1 << (g) )

Definition at line 335 of file ciptypes.h.

#define MASK8 (   a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
( 1 << (a) | 1 << (b) | 1 << (c) | 1 << (d) | 1 << (e) | 1 << (f) | \
1 << (g) | 1 << (h) )

Definition at line 337 of file ciptypes.h.

#define MAX_SIZE_OF_ADD_STATUS   2 /* for now we support extended status codes up to 2 16bit values there is mostly only one 16bit value used */

Definition at line 194 of file ciptypes.h.

Referenced by EncodeExtendedStatusDataItems().

Typedef Documentation

typedef struct cip_class CipClass

Class is a subclass of Instance.

Enum containing the encoding values for CIP data types for CIP Messages.

typedef struct cip_instance CipInstance

Service descriptor. These are stored in an array.

Enumeration Type Documentation

Enum containing the encoding values for CIP data types for CIP Messages.

Enumerator
kCipAny 

data type that can not be directly encoded

kCipBool 

boolean data type

kCipSint 

8-bit signed integer

kCipInt 

16-bit signed integer

kCipDint 

32-bit signed integer

kCipLint 

64-bit signed integer

kCipUsint 

8-bit unsigned integer

kCipUint 

16-bit unsigned integer

kCipUdint 

32-bit unsigned integer

kCipUlint 

64-bit unsigned integer

kCipReal 

Single precision floating point

kCipLreal 

Double precision floating point

kCipStime 

Synchronous time information*, type of DINT

kCipDate 

Date only

kCipTimeOfDay 

Time of day

kCipDateAndTime 

Date and time of day

kCipString 

Character string, 1 byte per character

kCipByte 

8-bit bit string

kCipWord 

16-bit bit string

kCipDword 

32-bit bit string

kCipLword 

64-bit bit string

kCipString2 

Character string, 2 byte per character

kCipFtime 

Duration in micro-seconds, high resolution; range of DINT

kCipLtime 

Duration in micro-seconds, high resolution, range of LINT

kCipItime 

Duration in milli-seconds, short; range of INT

kCipStringN 

Character string, N byte per character

kCipShortString 

Character string, 1 byte per character, 1 byte length indicator

kCipTime 

Duration in milli-seconds; range of DINT

kCipEpath 

CIP path segments

kCipEngUnit 

Engineering Units

kCipUsintUsint 

Used for CIP Identity attribute 4 Revision

kCipUdintUdintUdintUdintUdintString 

TCP/IP attribute 5 - IP address, subnet mask, gateway, IP name server 1, IP name server 2, domain name

kCip6Usint 

Struct for MAC Address (six USINTs)

kCipMemberList 
kCipByteArray 
kInternalUint6 

bogus hack, for port class attribute 9, TODO figure out the right way to handle it

Definition at line 17 of file ciptypes.h.

Definition of Get and Set Flags for CIP Attributes.

Enumerator
kNotSetOrGetable 

Neither set-able nor get-able

kGetableAll 

Get-able, also part of Get Attribute All service

kGetableSingle 

Get-able via Get Attribute

kSetable 

Set-able via Set Attribute

kSetAndGetAble 

both set and get-able

kGetableSingleAndAll 

both single and all

Definition at line 103 of file ciptypes.h.

Definition of CIP service codes.

An Enum with all CIP service codes. Common services codes range from 0x01 to 0x1C

Enumerator
kGetAttributeAll 
kSetAttributeAll 
kGetAttributeList 
kSetAttributeList 
kReset 
kStart 
kStop 
kCreate 
kDelete 
kMultipleServicePacket 
kApplyAttributes 
kGetAttributeSingle 
kSetAttributeSingle 
kFindNextObjectInstance 
kRestore 
kSave 
kNoOperation 
kGetMember 
kSetMember 
kInsertMember 
kRemoveMember 
kGroupSync 
kForwardOpen 
kForwardClose 
kUnconnectedSend 
kGetConnectionOwner 

Definition at line 68 of file ciptypes.h.

Enumerator
kConnectionPointTypeProducing 
kConnectionPointTypeConsuming 
kConnectionPointTypeConfig 
kConnectionPointTypeMaxValue 

Definition at line 159 of file ciptypes.h.

Enumerator
kIoConnectionEventOpened 
kIoConnectionEventTimedOut 
kIoConnectionEventClosed 

Definition at line 113 of file ciptypes.h.