Package com.automation_pros.odva.encap
Class TcpIpPort
- java.lang.Object
-
- All Implemented Interfaces:
DataContext
,AttributeHolder
,CipMsgProcessor
,java.lang.Comparable<CipInstance>
public class TcpIpPort extends EncapPort
Full implementation of a Device's TCP/IP port with both Target and Originator Capabilities, and Class 1 support.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
TcpIpPort.IOLinkConsumer
class
TcpIpPort.IOLinkProducer
protected class
TcpIpPort.IPv4DatagramChanFactory
protected class
TcpIpPort.McastChannelItem
protected class
TcpIpPort.McastGroupItem
class
TcpIpPort.McastLinkConsumer
protected class
TcpIpPort.TcpPortStarter
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.types.CipObject
CipObject.FutureMultipleReply
-
Nested classes/interfaces inherited from class com.automation_pros.odva.cip.types.CipTree
CipTree.ChildMap
-
-
Field Summary
Fields Modifier and Type Field Description protected java.net.InetSocketAddress
coreAddress
protected io.netty.channel.EventLoopGroup
encapBoss
protected io.netty.channel.ChannelFuture
encapServer
protected io.netty.channel.ChannelFuture
encapUdp
protected CipStruct
linkPathStruct
protected java.util.Map<java.net.InetAddress,java.util.Map<java.lang.Integer,ConxMapItem>>
peercxmaps
protected PortSeg
selfport
protected boolean
started
java.util.concurrent.ScheduledFuture<?>
starter
protected java.lang.Object
starterLock
protected TcpIpInstance
tcp
protected io.netty.channel.ChannelFuture
udpIO
protected io.netty.channel.EventLoopGroup
udpWork
-
Fields inherited from class com.automation_pros.odva.encap.EncapPort
encapWork, inboundEnabled, inetaddr, newSessionID, outboundEnabled
-
Fields inherited from class com.automation_pros.odva.cip.core.AbstractPort
appContext, conxlist, conxmgr, description, msgrouter, portname, portnum, porttype, producerScheduler, routing, typename
-
Fields inherited from class com.automation_pros.odva.cip.core.CipInstance
attr_all
-
Fields inherited from class com.automation_pros.odva.cip.types.CipTree
children, objEPath, parent, segment
-
Fields inherited from interface com.automation_pros.odva.cip.data.DataContext
emptyContext
-
-
Constructor Summary
Constructors Modifier Constructor Description TcpIpPort(PortMgr parent, int port, java.net.InetAddress addr)
protected
TcpIpPort(InstanceSeg seg, PortMgr parent, int port, java.lang.String name, java.net.InetAddress addr, int threads)
TcpIpPort(InstanceSeg seg, PortMgr parent, int port, java.net.InetAddress addr)
TcpIpPort(InstanceSeg seg, PortMgr parent, int port, java.net.InetAddress addr, int threads)
Construct a TCP/IP port with the given properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EncapList
createListIDReply(Encap packet)
java.util.Map<java.lang.Integer,ConxMapItem>
getCXMap(java.net.InetSocketAddress peer)
java.net.NetworkInterface
getInterface()
CipMsgProcessor
getUCMM(PortSeg seg)
java.net.InetAddress
mcastToPeer()
Ethernet/IP Class 0 and 1 Multicast addresses are allocated from Administrative Local Scope (RFC-2365) beginning at 239.192.1.0.void
shutdown()
void
shutdownELG()
-
Methods inherited from class com.automation_pros.odva.encap.EncapPort
dedicatedUCMM, getInetAddr, isInboundEnabled, isOutboundEnabled, setInboundEnabled, setOutboundEnabled
-
Methods inherited from class com.automation_pros.odva.cip.core.AbstractPort
getConxClass, getConxMgr, getDescription, getMaxMsg, getMsgRouter, getParent, getPortMgr, getPortname, getPortnum, getPorttype, getProducerScheduler, getRouting, getTypename, send, send, setDescription, setParent, setPortnum, setRouting
-
Methods inherited from class com.automation_pros.odva.cip.core.CipInstance
compareTo, getAttribute, getEPathImpl, getSegment, isPrivate, number, service, toString
-
Methods inherited from class com.automation_pros.odva.cip.types.CipObject
executor, getChild, getDevice, getDisplayName, getName, isShutdown, logger, onReplacement, removeChildSymbol, scheduler, setChild, setChildSymbol, setName
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTreeCtx
getCtxDataImpl, getNamedDef, getParentDataCtx, getTypeByCRC, getTypeByName, getTypesImpl
-
Methods inherited from class com.automation_pros.odva.cip.types.CipTree
cleanup, entrySet, follow, getChildren, getEPath, keySet, removeChild, setSegment
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.types.AttributeHolder
executor, getChild, getDisplayName, getEPath, isShutdown, logger, scheduler
-
Methods inherited from interface com.automation_pros.odva.cip.data.DataContext
fromEnum, getCtxData, getCtxDataOrNull, getTypes, makeHosted, makeUnhosted, toEnum
-
-
-
-
Field Detail
-
linkPathStruct
protected final CipStruct linkPathStruct
-
peercxmaps
protected final java.util.Map<java.net.InetAddress,java.util.Map<java.lang.Integer,ConxMapItem>> peercxmaps
-
selfport
protected final PortSeg selfport
-
starter
public final java.util.concurrent.ScheduledFuture<?> starter
-
encapBoss
protected io.netty.channel.EventLoopGroup encapBoss
-
udpWork
protected io.netty.channel.EventLoopGroup udpWork
-
encapServer
protected io.netty.channel.ChannelFuture encapServer
-
encapUdp
protected io.netty.channel.ChannelFuture encapUdp
-
udpIO
protected io.netty.channel.ChannelFuture udpIO
-
tcp
protected TcpIpInstance tcp
-
coreAddress
protected java.net.InetSocketAddress coreAddress
-
starterLock
protected java.lang.Object starterLock
-
started
protected boolean started
-
-
Constructor Detail
-
TcpIpPort
public TcpIpPort(PortMgr parent, int port, java.net.InetAddress addr)
-
TcpIpPort
public TcpIpPort(InstanceSeg seg, PortMgr parent, int port, java.net.InetAddress addr)
-
TcpIpPort
public TcpIpPort(InstanceSeg seg, PortMgr parent, int port, java.net.InetAddress addr, int threads)
Construct a TCP/IP port with the given properties. Bus devices will be accessed with implicit connections (no actual message buffering).- Parameters:
seg
- Indicates the instance number to create/replace, or null to use the lowest available instance.parent
- A Port Manager class objectport
- The port number in the parent device. Non-zero.addr
- The address on the network to occupy.threads
- The number of threads to use in the produced I/O data scheduler.
-
TcpIpPort
protected TcpIpPort(InstanceSeg seg, PortMgr parent, int port, java.lang.String name, java.net.InetAddress addr, int threads)
-
-
Method Detail
-
shutdownELG
public void shutdownELG()
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceAttributeHolder
- Overrides:
shutdown
in classEncapPort
-
getUCMM
public CipMsgProcessor getUCMM(PortSeg seg)
-
getInterface
public java.net.NetworkInterface getInterface()
-
getCXMap
public java.util.Map<java.lang.Integer,ConxMapItem> getCXMap(java.net.InetSocketAddress peer)
-
mcastToPeer
public java.net.InetAddress mcastToPeer()
Ethernet/IP Class 0 and 1 Multicast addresses are allocated from Administrative Local Scope (RFC-2365) beginning at 239.192.1.0. Each host device will choose from a block of 32 addresses beginning with its own IP address's lower 10 bits, shifted right by 5, added to the multicast base.This library distributes the multicast addresses to balance total packet rate for a given address.
- Returns:
- The chosen multicast address or null if the address could not be computed.
-
-