LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2006 Georgia Tech Research Corporation | 3 * Copyright (c) 2006 Georgia Tech Research Corporation |
4 * 2007 INRIA | 4 * 2007 INRIA |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ns3/callback.h" | 28 #include "ns3/callback.h" |
29 #include "ns3/ptr.h" | 29 #include "ns3/ptr.h" |
30 #include "ns3/object.h" | 30 #include "ns3/object.h" |
31 #include "ns3/nstime.h" | 31 #include "ns3/nstime.h" |
32 | 32 |
33 namespace ns3 { | 33 namespace ns3 { |
34 | 34 |
35 class Node; | 35 class Node; |
36 class Packet; | 36 class Packet; |
37 | 37 |
| 38 /* Names of the 11 TCP states */ |
| 39 typedef enum { |
| 40 CLOSED, // 0 |
| 41 LISTEN, // 1 |
| 42 SYN_SENT, // 2 |
| 43 SYN_RCVD, // 3 |
| 44 ESTABLISHED, // 4 |
| 45 CLOSE_WAIT, // 5 |
| 46 LAST_ACK, // 6 |
| 47 FIN_WAIT_1, // 7 |
| 48 FIN_WAIT_2, // 8 |
| 49 CLOSING, // 9 |
| 50 TIME_WAIT, // 10 |
| 51 LAST_STATE } TcpStates_t; |
| 52 |
38 /** | 53 /** |
39 * \ingroup socket | 54 * \ingroup socket |
40 * | 55 * |
41 * \brief (abstract) base class of all TcpSockets | 56 * \brief (abstract) base class of all TcpSockets |
42 * | 57 * |
43 * This class exists solely for hosting TcpSocket attributes that can | 58 * This class exists solely for hosting TcpSocket attributes that can |
44 * be reused across different implementations. | 59 * be reused across different implementations. |
45 */ | 60 */ |
46 class TcpSocket : public Socket | 61 class TcpSocket : public Socket |
47 { | 62 { |
48 public: | 63 public: |
49 static TypeId GetTypeId (void); | 64 static TypeId GetTypeId (void); |
50 · | 65 · |
51 TcpSocket (void); | 66 TcpSocket (void); |
52 virtual ~TcpSocket (void); | 67 virtual ~TcpSocket (void); |
| 68 |
| 69 // Literal names of TCP states for use in log messages */ |
| 70 static const char* const TcpStateName[LAST_STATE]; |
53 | 71 |
54 private: | 72 private: |
55 // Indirect the attribute setting and getting through private virtual methods | 73 // Indirect the attribute setting and getting through private virtual methods |
56 virtual void SetSndBufSize (uint32_t size) = 0; | 74 virtual void SetSndBufSize (uint32_t size) = 0; |
57 virtual uint32_t GetSndBufSize (void) const = 0; | 75 virtual uint32_t GetSndBufSize (void) const = 0; |
58 virtual void SetRcvBufSize (uint32_t size) = 0; | 76 virtual void SetRcvBufSize (uint32_t size) = 0; |
59 virtual uint32_t GetRcvBufSize (void) const = 0; | 77 virtual uint32_t GetRcvBufSize (void) const = 0; |
60 virtual void SetSegSize (uint32_t size) = 0; | 78 virtual void SetSegSize (uint32_t size) = 0; |
61 virtual uint32_t GetSegSize (void) const = 0; | 79 virtual uint32_t GetSegSize (void) const = 0; |
62 virtual void SetSSThresh (uint32_t threshold) = 0; | 80 virtual void SetSSThresh (uint32_t threshold) = 0; |
(...skipping 11 matching lines...) Expand all Loading... |
74 virtual void SetPersistTimeout (Time timeout) = 0; | 92 virtual void SetPersistTimeout (Time timeout) = 0; |
75 virtual Time GetPersistTimeout (void) const = 0; | 93 virtual Time GetPersistTimeout (void) const = 0; |
76 ·· | 94 ·· |
77 }; | 95 }; |
78 | 96 |
79 } //namespace ns3 | 97 } //namespace ns3 |
80 | 98 |
81 #endif /* TCP_SOCKET_H */ | 99 #endif /* TCP_SOCKET_H */ |
82 | 100 |
83 | 101 |
LEFT | RIGHT |