Commit c5ad3bf0 authored by garciay's avatar garciay
Browse files

Enhance comments

parent e0664f67
Loading
Loading
Loading
Loading
+59 −17
Original line number Diff line number Diff line
@@ -8,18 +8,39 @@
module AtsCommon_Tcpv4_Rfc793_TypesAndValues {
    
    //LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_DataStrings all;
    import from LibCommon_BasicTypesAndValues {
        type UInt16, UInt32
    };
    import from LibCommon_DataStrings {
        type Bit1, Bit3, Bit4
    };
    
    /**
     * @desc TCP segment structure
     * @member srcPort          Identifies the sending port
     * @member dstPort          Identifies the receiving port
     * @member seqNumber        Initial/accumulated sequence number 
     * @member ackNumber        Next sequence number (if ACK flag set)
     * @member dataOffset       Specifies the size of the TCP header in 32-bit words
     * @member reserved         Not used. Should be zero
     * @member flags            Aka Control bits
     * @member widowSize        Size of the receive window
     * @member checksum         16-bit checksum field is used for error-checking
     * @member urgentPointer    Offset from the sequence number indicating the last urgent data byte (if URG flag set)
     * @member options          Options field
     * @member pad              Padding used to ensure that the TCP header ends and data begins on a 32 bit boundary
     * @member payload          TCP payload
     * @reference http://tools.ietf.org/html/rfc793
     */
    type record TCPPv4Msg {
        UInt16          srcPort,            // Identifies the sending port
        UInt16          dstPort,            // Identifies the receiving port
        UInt16          srcPort,
        UInt16          dstPort,
        UInt32          seqNumber,
        UInt32          ackNumber optional, // present if ack bit set
        Bit4            dataOffset,         // Specifies the size of the TCP header in 32-bit words
        UInt32          ackNumber optional,
        Bit4            dataOffset,
        Bit3            reserved('000'B), 
        TCPv4Flags      flags,              // Aka Control bits
        UInt16          widowSize,          // Size of the receive window
        TCPv4Flags      flags,
        UInt16          widowSize,
        UInt16          checksum,
        UInt16          urgentPointer,
        octetstring     options length(0..40),
@@ -27,19 +48,40 @@ module AtsCommon_Tcpv4_Rfc793_TypesAndValues {
        TCPv4Payload    payload
    } // End of type TCPPv4Msg
    
    /**
     * @desc Aka Control bits
     * @member ns   ECN-nonce concealment protection (added to header by RFC 3540)
     * @member cwr  Congestion Window Reduced
     * @member ece  ECN-Echo indicator
     * @member urg  Urgent Pointer field significant
     * @member ack  Acknowledgment field significant
     * @member psh  Push Function
     * @member rst  Reset the connection
     * @member syn  Synchronize sequence numbers
     * @member fin  No more data from sender
     * @reference http://tools.ietf.org/html/rfc793, http://tools.ietf.org/html/rfc3540
     */
    type record TCPv4Flags {
        Bit1    ns,     // ECN-nonce concealment protection (added to header by RFC 3540)
        Bit1    cwr,    // Congestion Window Reduced
        Bit1    ece,    // ECN-Echo indicator
        Bit1    urg,    // Urgent Pointer field significant
        Bit1    ack,    // Acknowledgment field significant
        Bit1    psh,    // Push Function
        Bit1    rst,    // Reset the connection
        Bit1    syn,    // Synchronize sequence numbers
        Bit1    fin     // No more data from sender
        Bit1    ns,
        Bit1    cwr,
        Bit1    ece,
        Bit1    urg,
        Bit1    ack,
        Bit1    psh,
        Bit1    rst,
        Bit1    syn,
        Bit1    fin
    } // End of type TCPv4Flags
    
    /**
     * @desc 
     * @member ftpPayload   FTP payload
     * @member httpPayload  HTTP payload
     * @member rawPayload   Raw payload
     */
    type union TCPv4Payload {
        octetstring ftpPayload, // FIXME Used correct type
        octetstring httpPayload,  // FIXME Used correct type
        octetstring rawPayload
    } // End of type TCPv4Payload