File: sshcron.h

package info (click to toggle)
ssh-cron 2.00.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 840 kB
  • sloc: cpp: 1,372; fortran: 200; makefile: 99; sh: 36; ansic: 10
file content (51 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef INCLUDED_SSHCRON_
#define INCLUDED_SSHCRON_

#include <memory>

#include <bobcat/fork>
#include <bobcat/localclientsocket>

#include "../udsreq/udsreq.h"

namespace FBB
{
    class IFdStream;
    class OFdStream;
}

class Options;

class SSHCron: public FBB::Fork, private UDSReq
{
    Options &d_options;
    FBB::LocalClientSocket d_client;
    std::string d_passphrase;
    std::unique_ptr<FBB::IFdStream> d_in;
    std::unique_ptr<FBB::OFdStream> d_out;

    public:
        SSHCron();
        ~SSHCron() override;

        void run();

    private:
        void childProcess()     override;
        void parentProcess()    override;

        void askPassphrase();
        std::ostream &basename() const; // options.msg() inserts basename :
        void toCron();                  // commands to the child, e.g., --list
        void daemon();                  // run the daemon in the background
        void foreground();
        void getPassphrase();
        std::ostream &idmsg() const;    // imsg inserts "'basename' : "
        void list();
        void reload();
        void terminate();
};
        
#endif