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) 2014 Universita' di Firenze | 3 * Copyright (c) 2014 Universita' di Firenze |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 /** | 49 /** |
50 * \brief Get the type ID. | 50 * \brief Get the type ID. |
51 * \return the object TypeId | 51 * \return the object TypeId |
52 */ | 52 */ |
53 static TypeId GetTypeId (void); | 53 static TypeId GetTypeId (void); |
54 | 54 |
55 PacketSocketServer (); | 55 PacketSocketServer (); |
56 | 56 |
57 virtual ~PacketSocketServer (); | 57 virtual ~PacketSocketServer (); |
58 | 58 |
| 59 /** |
| 60 * \brief set the local address and protocol to be used |
| 61 * \param addr local address |
| 62 */ |
| 63 void SetLocal (PacketSocketAddress addr); |
| 64 |
59 protected: | 65 protected: |
60 virtual void DoDispose (void); | 66 virtual void DoDispose (void); |
61 | 67 |
62 private: | 68 private: |
63 | 69 |
64 virtual void StartApplication (void); | 70 virtual void StartApplication (void); |
65 virtual void StopApplication (void); | 71 virtual void StopApplication (void); |
66 | 72 |
67 /** | 73 /** |
68 * \brief Handle a packet received by the application | 74 * \brief Handle a packet received by the application |
69 * \param socket the receiving socket | 75 * \param socket the receiving socket |
70 */ | 76 */ |
71 void HandleRead (Ptr<Socket> socket); | 77 void HandleRead (Ptr<Socket> socket); |
72 | 78 |
73 uint32_t m_pktRx; //!< The number of received packets | 79 uint32_t m_pktRx; //!< The number of received packets |
74 uint32_t m_bytesRx; //!< Total bytes received | 80 uint32_t m_bytesRx; //!< Total bytes received |
75 | 81 |
76 Ptr<Socket> m_socket; //!< Socket | 82 Ptr<Socket> m_socket; //!< Socket |
| 83 PacketSocketAddress m_localAddress; //!< Local address |
| 84 bool m_localAddressSet; //!< Sanity check |
77 | 85 |
78 /// Traced Callback: received packets, source address. | 86 /// Traced Callback: received packets, source address. |
79 TracedCallback<Ptr<const Packet>, const Address &> m_rxTrace; | 87 TracedCallback<Ptr<const Packet>, const Address &> m_rxTrace; |
80 }; | 88 }; |
81 | 89 |
82 } // namespace ns3 | 90 } // namespace ns3 |
83 | 91 |
84 #endif /* PACKET_SOCKET_SERVER_H */ | 92 #endif /* PACKET_SOCKET_SERVER_H */ |
LEFT | RIGHT |