Source code: com/voytechs/jnetanalyzer/tcp/swing/JTCPSegment.java
1 /*
2 * File: JTCPSegment.java
3 * Auth: Mark Bednarczyk
4 * Date: DATE
5 * Id: $Id: JTCPSegment.java,v 1.1.1.1 2003/09/22 16:32:06 voytechs Exp $
6 ********************************************
7 Copyright (C) 2003 Mark Bednarczyk
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 ********************************************
23 * $Log: JTCPSegment.java,v $
24 * Revision 1.1.1.1 2003/09/22 16:32:06 voytechs
25 * Initial import.
26 *
27 */
28 package com.voytechs.jnetanalyzer.tcp.swing;
29
30 import com.voytechs.jnetstream.protocol.layer4.*;
31 import com.voytechs.jnetstream.protocol.*;
32 import com.voytechs.jnetanalyzer.tcp.*;
33 import com.voytechs.jnetanalyzer.message.swing.*;
34
35 import java.lang.*;
36 import java.util.*;
37
38 /**
39 *
40 */
41 public class JTCPSegment
42 extends JMessageSegment {
43
44 /* Internal attributes */
45 private static final boolean debug = false;
46
47 private TCPSegment tcpSegment;
48 // private Packet packet;
49
50 /**
51 *
52 * @param
53 * @exception
54 */
55 public JTCPSegment(TCPSegment segment) {
56
57 this.tcpSegment = segment;
58 // this.packet = packet;
59
60 setLabel1Text("" + tcpSegment.getTCPHeader().seq);
61 setLabel2Text("" + (tcpSegment.getTCPHeader().seq + tcpSegment.getLength()));
62 setLabel3Text("" + tcpSegment.getLength());
63 setLabel4Text("ack:" + tcpSegment.getTCPHeader().ack);
64
65 setTimeout(15 * 1000);
66 }
67
68 /**
69 * Returns the seqence number.
70 */
71 public long getSeq() {
72 return(tcpSegment.getSeq());
73 }
74
75 /**
76 * Returns the seqence number.
77 */
78 public long getAck() {
79 return(tcpSegment.getAck());
80 }
81
82 /**
83 * Returns the length of segment.
84 */
85 public int getLength() {
86 return(tcpSegment.getLength());
87 }
88
89 /**
90 * Test function for JTCPSegment
91 * @param args command line arguments
92 */
93 public static void main(String [] args) {
94 }
95
96 } /* END OF: JTCPSegment */