Package org.hxzon.netprotocol.packet

Examples of org.hxzon.netprotocol.packet.TcpPacket


        new EthernetPacket();
        new VlanPacket();
        new GoosePacket();
        new SvPacket();
        new Ip4Packet();
        new TcpPacket();
        new UdpPacket();
        new TpktPacket();
        new CotpPacket();
        new OsiSessionPacket();
        new ArpPacket();
View Full Code Here


    private static Map<Integer, CotpPacketGroup> groups = new HashMap<Integer, CotpPacketGroup>();

    public static void addCotpPacket(CotpPacket cotpPacket) {
        Ip4Packet ip4Packet = null;
        TcpPacket tcpPacket = null;
        for (IPacket parent = cotpPacket.getSrcPacket();;) {
            if (parent instanceof Ip4Packet) {
                ip4Packet = (Ip4Packet) parent;
                break;
            } else if (parent instanceof TcpPacket) {
                tcpPacket = (TcpPacket) parent;
            }
            parent = parent.getSrcPacket();
        }
        if (ip4Packet == null || tcpPacket == null) {
            return;
        }
        int protocolCode = ip4Packet.fetchProtocolCode().getValue();
        long sourceIp = ip4Packet.fetchSourceIp().getValue();
        long destIp = ip4Packet.fetchDestIp().getValue();
        int sourcePort = tcpPacket.fetchSourcePort().getValue();
        int destPort = tcpPacket.fetchDestPort().getValue();
        int key = new HashCodeBuilder().append(protocolCode).append(sourceIp).append(destIp).append(sourcePort).append(destPort).toHashCode();
        CotpPacketGroup group = groups.get(key);
        if (group == null && !cotpPacket.isLastUnit()) {
            group = new CotpPacketGroup(key);
            groups.put(key, group);
View Full Code Here

TOP

Related Classes of org.hxzon.netprotocol.packet.TcpPacket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.