Ejemplo n.º 1
0
        public bool CacheTcpIpTerminationRecord(RecConnection record)
        {
            ConsoleDataSet ds = new ConsoleDataSet();

            ConsoleDataSet.Connection_RecordsRow row = ds.Connection_Records.NewConnection_RecordsRow();

            row.Conn_End_Time       = record.EndTime;
            row.Conn_PID            = record.PartitionId;
            row.Conn_Protocol       = record.ProtocolFormatter(record.Protocol, record.FlagAA);
            row.Conn_Start_Time     = record.StartTime;
            row.Conn_State          = record.StateFormatter(record.State);
            row.Foreign_IP          = record.ForeignIp;
            row.Foreign_Port        = record.ForeignPort;
            row.Highest_Depth       = record.HighestDepth;
            row.In_Retr_Mode        = record.InRetransmitMode;
            row.Inbound_Bytes       = record.InboundByte;
            row.Inbound_Bytes_Dup   = record.InboundByteDup;
            row.Inbound_Data        = record.InboundIBBK;
            row.Inbound_Data_Dup    = record.InboundIBBKDup;
            row.Inbound_Eff         = record.InboundEfficiency;
            row.INT_EXT             = record.LocalCallFormatter(record.LocalCall);
            row.Local_Port          = record.LocalPort;
            row.Max_Recv_Window     = record.MaxRecvWindow;
            row.Max_Send_Window     = record.MaxSendWindow;
            row.Outbound_Bytes      = record.OutboundByte;
            row.Outbound_Bytes_Retr = record.OutboundByteDup;
            row.Outbound_Data       = record.OutboundIBBK;
            row.Outbound_Data_Retr  = record.OutboundIBBKDup;
            row.Outbound_Eff        = record.OutboundEfficiency;
            row.Recv_Window_Closed  = record.RecvWindowClosed;
            row.Recvs_Issued        = record.RcvdSocket;
            row.Retransmits         = record.Retransmitted;
            row.Sends_Issued        = record.SendSocket;
            row.SWS_Count           = record.Sws;

            ds.Connection_Records.AddConnection_RecordsRow(row);
            managerCCR.AddRecord(row);

            return(true);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="table"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public override string GetTextAt(DataTable table, int index)
        {
            ConsoleDataSet.Connection_RecordsRow row = (ConsoleDataSet.Connection_RecordsRow)table.Rows[index];

            return(FormatText(new TcpIpTerminationRecord(
                                  TcpIpTerminationRecord.StateUnformatter(row.Conn_State),
                                  TcpIpTerminationRecord.ProtocolUnformatter(row.Conn_Protocol),
                                  row.Conn_Start_Time,
                                  (ushort)row.Local_Port,
                                  (ushort)row.Foreign_Port,
                                  row.Foreign_IP,
                                  TcpIpTerminationRecord.FlagAAUnformatter(row.Conn_Protocol),
                                  TcpIpTerminationRecord.LocalCallUnformatter(row.INT_EXT),
                                  (ulong)row.Retransmits,
                                  (ulong)row.Inbound_Data,
                                  (ulong)row.Inbound_Data_Dup,
                                  (ulong)row.Inbound_Bytes,
                                  (ulong)row.Inbound_Bytes_Dup,
                                  (ulong)row.Outbound_Data,
                                  (ulong)row.Outbound_Data_Retr,
                                  (ulong)row.Outbound_Bytes,
                                  (ulong)row.Outbound_Bytes_Retr,
                                  (ulong)row.SWS_Count,
                                  (ulong)row.In_Retr_Mode,
                                  (ulong)row.Recv_Window_Closed,
                                  (ulong)row.Highest_Depth,
                                  (ulong)row.Sends_Issued,
                                  (ulong)row.Recvs_Issued,
                                  (uint)row.Max_Send_Window,
                                  (uint)row.Max_Recv_Window,
                                  row.Conn_End_Time,
                                  row.Conn_PID,
                                  0 /* not stored in DB */)).ToString());



            //return FormatText(TcpIpTerminationRecord.ToString(row.Conn_End_Time, row.Conn_PID, row.Conn_Protocol, row.Local_Port, row.Foreign_IP, row.Foreign_Port));
        }