Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/voytechs/jnetanalyzer/tcp/TCPAddress.java


1   /*
2    * File: TCPAddress.java
3    * Auth: Mark Bednarczyk
4    * Date: DATE
5    *   Id: $Id: TCPAddress.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: TCPAddress.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;
29  
30  import com.voytechs.jnetstream.primitive.address.*;
31  
32  import java.lang.*;
33  import java.util.*;
34  
35  /**
36   * 
37   */
38  public class TCPAddress {
39    /* Internal attributes */
40    private static final boolean debug = false;
41  
42    public IpAddress srcAddress;
43    public int srcPort;
44  
45    public IpAddress dstAddress;
46    public int dstPort;
47  
48    /**
49     *
50     * @param
51     * @exception
52     */
53    public TCPAddress(IpAddress srcAddress, int srcPort, IpAddress dstAddress, int dstPort) {
54      
55      this.srcAddress = srcAddress;
56      this.srcPort = srcPort;
57  
58      this.dstAddress = dstAddress;
59      this.dstPort = dstPort;
60    }
61  
62    /**
63     * Converts TCP address to string.
64     */
65    public String toString() {
66      
67      String s = "";
68      s += srcAddress.toString() + "." + srcPort;
69      s += " > ";
70      s += dstAddress.toString() + "." + dstPort;
71  
72      return(s);
73    }
74  
75    /**
76     * Test function for TCPAddress
77     * @param args command line arguments
78     */
79    public static void main(String [] args) {
80    }
81  
82  } /* END OF: TCPAddress */