TLSContext (FB) ¶ FUNCTION_BLOCK PUBLIC FINAL TLSContext IMPLEMENTS ITLSContext , ITLSContext_Internal Encapsulates all the data neccecray to handle encrypted tcp connections Static initialization, as shown in the following code snippet. VAR commonName : STRING := 'MyRrasPi' ; ciCertInfo : NBS.CERT_INFO := ( psInfo := ADR ( commonName ), udiSize := LEN ( commonName )); myTLSContext : NBS.TLSContext := ( ePurpose := NBS.PURPOSE.CLIENT_SIDE , sUseCaseName := 'NBSTest' , sTLSVersion := '1.3' , ciCertInfo := ciCertInfo , udiVerificationMode := 2 ); END_VAR InOut: Scope Name Type Initial Comment Input Const sUseCaseName STRING A name to identify this context in the security manager ePurpose PURPOSE This context can be used on the server side or on the client side. sTLSVersion TLS_VERSION ‘1.2’ A string to select the correct protocol version sCipherList CIPHER_LIST STRUCT(psList := ADR(‘HIGH’), udiSize := 5) A string to select the correct encryption cipher suites. See for example: https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT sHostname HOSTNAME A hostname to select the correct certificate on the server side. udiVerificationMode UDINT 1 1 => No peer verification 2 => Active Peer verification (4) => 2+4 = 6 => Force termination, if no client certificate (8) => 2+8=10 or 2+4+8 = 14 => Request client certificate only whithin initial handshake ciCertInfo REFERENCE TO CERT_INFO A string to select the correct certificate in local certificate store itfCertVerifer ICertificateVerifier A callback for application specific cerificate verification Methods: SetInitialValue Structure: SetInitialValue (Method)
UDP ¶ UDP_Packet CreatePacket (Function) CreatePacketPool (Function) PacketPool (FunctionBlock) IPacketPool GetPacket (Method) SetInitialValue (Method) PacketQueue (FunctionBlock) IPacketQueue GetPacket (Method) PutPacket (Method) UDP_Peer (FunctionBlock) IOptionConsumer SetOptionProvider (Method) Receive (Method) Receive2 (Method) Send (Method) SetInitialValue (Method) UDP_Processor (FunctionBlock) IUDPProcessor ProcessPacket (Method) NonBlocking (Property) SetInitialValue (Method) UDP_Receive (FunctionBlock) UDP_Receiver (FunctionBlock) SetInitialValue (Method) UDP_Send (FunctionBlock) UDP_Sender (FunctionBlock) SetInitialValue (Method)
UDP_Packet ¶ CreatePacket (Function) CreatePacketPool (Function) PacketPool (FunctionBlock) IPacketPool GetPacket (Method) SetInitialValue (Method) PacketQueue (FunctionBlock) IPacketQueue GetPacket (Method) PutPacket (Method)
UDP_Peer (FB) ¶ FUNCTION_BLOCK PUBLIC FINAL UDP_Peer EXTENDS LConC IMPLEMENTS IPeer , IOptionConsumer This function block activates a Peer by setting xEnable to TRUE. A peer encapsulates all the necessary things for sending and receiving data over the UDP protocol. The output itfPeer can be contected with UDP_Receive , UDP_Receiver , UDP_Send and UDP_Sender . The Send and Receive methods can also be used as an alternative to the related traditional function blocks. Sending or receiving multicast telegrams is only possible if the input itfMulticast has been assigned accordingly with an IPAddressSet or IPv4Address . InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Activates the defined operation FALSE : Aborts/resets the defined operation LConC Output xBusy BOOL TRUE : Operation is running LConC xError BOOL TRUE : Error condition reached LConC eErrorID ERROR LConC Input Const itfAsyncProperty IAsyncProperty Input itfIPAddress IIPAddress IP Address of the specific Adpater for Receiving/Sending (The related Networkmask and Broadcast adresses for receiving will be calculated) uiPort UINT Receive Port itfMulticast IIPAddressSet One or more Multicast Groups (optional) Output xActive BOOL TRUE if the peer context is established itfPeer IPeer The established context of this peer Valid, as long xActive = TRUE Methods: Receive Receive2 Send SetInitialValue SetOptionProvider Structure: IOptionConsumer SetOptionProvider (Method) Receive (Method) Receive2 (Method) Send (Method) SetInitialValue (Method)
UDP_Processor (FB) ¶ FUNCTION_BLOCK PUBLIC ABSTRACT UDP_Processor EXTENDS LConC IMPLEMENTS IUDPProcessor Provides the ability to evaluate or manipulate the flow of packets between UDP_Receiver and UDP_Sender via the specific implementation of the AsyncAction method. InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Activates the defined operation FALSE : Aborts/resets the defined operation LConC Output xBusy BOOL TRUE : Operation is running LConC xError BOOL TRUE : Error condition reached LConC eErrorID ERROR LConC Input Const itfAsyncProperty IAsyncProperty itfPacketPool IPacketPool Input itfReceiver IPacketQueue Output itfSender IPacketQueue udiCount UDINT Properties: NonBlocking Methods: SetInitialValue ProcessPacket Structure: IUDPProcessor ProcessPacket (Method) NonBlocking (Property) SetInitialValue (Method)
UDP_Receive (FB) ¶ FUNCTION_BLOCK PUBLIC FINAL UDP_Receive EXTENDS LConC This function block serves to receive data. The pointer pData specifies the memory area to write the read data to. udiSize defines the max number of bytes to read. When data was read successfully, xReady is set to TRUE and udiCount indicates the actually read number of bytes. itfIPAddressFrom and uiPortFrom indicate the ip and port the data was received from. InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Activates the defined operation FALSE : Aborts/resets the defined operation LConC Output xBusy BOOL TRUE : Operation is running LConC xError BOOL TRUE : Error condition reached LConC eErrorID ERROR LConC Input itfPeer IPeer pData __XWORD udiSize UDINT Output xReady BOOL itfIPAddressFrom IIPAddress uiPortFrom UINT udiCount UDINT
UDP_Receiver (FB) ¶ FUNCTION_BLOCK PUBLIC FINAL UDP_Receiver EXTENDS LConC Reads the data from the IPeer instance and passes it on via the IPacketQueue instance ( itfPackets ) in the form of IPacket instances InOut: Scope Name Type Comment Inherited from Input xEnable BOOL TRUE : Activates the defined operation FALSE : Aborts/resets the defined operation LConC Output xBusy BOOL TRUE : Operation is running LConC xError BOOL TRUE : Error condition reached LConC eErrorID ERROR LConC Input Const itfAsyncProperty IAsyncProperty itfPacketPool IPacketPool Input itfPeer IPeer Output itfPackets IPacketQueue udiCount UDINT Methods: SetInitialValue Structure: SetInitialValue (Method)
OPERATION (ENUM) ¶ TYPE OPERATION : Attributes: qualified_only InOut: Name UNKNOWN SET_OPTION GET_OPTION
PURPOSE (ENUM) ¶ TYPE PURPOSE : Attributes: qualified_only InOut: Name Comment UNKNOWN CLIENT_SIDE Indicates that a TLSContext may be used e.g. to authenticate Web servers (therefore, it will be used to create client-side sockets). SERVER_SIDE Indicates that a TLSContext may be used to authenticate e.g. Web clients (therefore, it will be used to create server-side sockets). CLIENT_SIDE_STARTTLS Indicates that a TLSContext may be used e.g. to authenticate Web servers (therefore, it will be used to create client-side sockets). After a “normal” TCP/IP connection is established this connection can be upgraded to a TLS encrypted connection.
TRANSMISSION (ENUM) ¶ TYPE TRANSMISSION : Attributes: qualified_only InOut: Name Comment UNKOWN UNICAST An one by one communication BROADCAST One communicates with all in the same network SUB_NETWORK_BROADCAST One communicates with all in the same subnetwork MULTICAST One communicates with all in the same group