1 /******************************************************************************
2     (c) 2001 Christine Caulfield                 christine.caulfield@googlemail.com
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 ******************************************************************************/
14 
15 class LocalPort
16 {
17  public:
18     LocalPort(unsigned char *service, unsigned char *portname, unsigned char *devname,
19 	      unsigned char *remnode, bool queued, bool clean, unsigned char *password);
20 
21     LocalPort(const LocalPort &p);
22     ~LocalPort();
23 
24   void do_read();
25   void disconnect_session(int reason);
26   void restart_pty();
27   int get_port_fd();
28   void show_info(bool verbose, std::ostringstream &output);
29   void close_and_delete();
get_devname()30   const std::string &get_devname() { return devname; };
31   void init_port();
32 
33  private:
34 
35   bool connect_session();
36 
37   std::string service;
38   std::string portname;
39   std::string devname;
40   std::string remnode;
41   std::string password;
42   bool queued;
43   bool clean;
44   bool slave_fd_open;
45   bool connected;
46   char ptyname[255];
47 
48   int master_fd;
49   int slave_fd;
50 };
51