ns-3 Direct Code Execution
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
unix-stream-socket-fd.h
Go to the documentation of this file.
1 #ifndef UNIX_STREAM_SOCKET_FD_H
2 #define UNIX_STREAM_SOCKET_FD_H
3 
4 #include "unix-socket-fd.h"
5 #include <list>
6 
7 namespace ns3 {
8 
10 {
11 public:
12  UnixStreamSocketFd (Ptr<Socket> sock, bool connected = 0);
13  virtual ~UnixStreamSocketFd (void);
14 private:
15  enum State
16  {
18 // BINDED,
20 // ACCEPTING,
24  CLOSING, // wait for socket close callback
26  };
27  virtual int Close (void);
28  virtual ssize_t DoRecvmsg (struct msghdr *msg, int flags);
29  virtual ssize_t DoSendmsg (const struct msghdr *msg, int flags);
30  virtual int Listen (int backlog);
31  virtual int Accept (struct sockaddr *my_addr, socklen_t *addrlen);
32  virtual int Shutdown (int how);
33  virtual bool CanRecv (void) const;
34  virtual bool CanSend (void) const;
35  virtual bool HangupReceived (void) const;
36  virtual int Connect (const struct sockaddr *my_addr, socklen_t addrlen);
37  virtual int Getpeername (struct sockaddr *name, socklen_t *namelen);
38  virtual int Poll (PollTable* ptable);
39 
40  bool ConnectionRequest (Ptr<Socket> sock, const Address & from);
41  void ConnectionCreated (Ptr<Socket> sock, const Address & from);
42 
43  void ConnectionSuccess (Ptr<Socket> sock);
44  void ConnectionError (Ptr<Socket> sock);
45 
46  void CloseSuccess (Ptr<Socket> sock);
47  void CloseError (Ptr<Socket> sock);
48 
49  void SetPeerAddress (Address *a);
50 
51  void MainSend (int *r, Ptr<Packet> p);
52 
53  std::list<std::pair<Ptr<Socket>,Address> > m_connectionQueue;
54  int m_backlog;
56  Address* m_peerAddress;
58 };
59 
60 } // namespace ns3
61 
62 #endif /* UNIX_STREAM_SOCKET_FD_H */