plptools
Loading...
Searching...
No Matches
wprt.h
Go to the documentation of this file.
1/*
2 * This file is part of plptools.
3 *
4 * Copyright (C) 1999-2001 Fritz Elfert <felfert@to.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
18 *
19 */
20#ifndef _WPRT_H_
21#define _WPRT_H_
22
23#include "rfsv.h"
24#include "Enum.h"
25
26class TCPSocket;
27class bufferStore;
28class bufferArray;
29
34class wprt {
35public:
36 wprt(TCPSocket *);
37
41 ~wprt();
42
47 void reset();
48
55 void reconnect();
56
64
69
74
79
83 bool stop();
84
85protected:
89 enum commands {
90 WPRT_INIT = 0x00,
91 WPRT_GET = 0xf0,
93 WPRT_STOP = 0xff
94 };
95
101
106
121 bool sendCommand(enum commands cc, bufferStore &data);
122
124 const char *getConnectName();
125
126};
127
128#endif
Wrapper class featuring range-checking and string representation of enumerated values.
Definition: Enum.h:136
A class for dealing with sockets.
Definition: tcpsocket.h:38
An array of bufferStores.
Definition: bufferarray.h:31
A generic container for an array of bytes.
Definition: bufferstore.h:37
Remote Print services via PLP.
Definition: wprt.h:34
bool sendCommand(enum commands cc, bufferStore &data)
Sends a command to the remote side.
Definition: wprt.cc:87
Enum< rfsv::errs > cancelJob()
Cancels a running job.
Definition: wprt.cc:138
Enum< rfsv::errs > getResponse(bufferStore &data)
Definition: wprt.cc:155
Enum< rfsv::errs > status
The current status of the connection.
Definition: wprt.h:105
void reset()
Initializes a connection to the remote machine.
Definition: wprt.cc:58
TCPSocket * skt
The socket, used for communication with ncpd.
Definition: wprt.h:100
void reconnect()
Attempts to re-establish a remote connection by first closing the socket, then connecting again to th...
Definition: wprt.cc:50
commands
The possible commands.
Definition: wprt.h:89
@ WPRT_CANCEL
Definition: wprt.h:92
@ WPRT_STOP
Definition: wprt.h:93
@ WPRT_INIT
Definition: wprt.h:90
@ WPRT_GET
Definition: wprt.h:91
Enum< rfsv::errs > initPrinter()
Init Printer.
Definition: wprt.cc:109
bool stop()
Stops the WPRT server.
Definition: wprt.cc:149
~wprt()
Virtual destructor.
Definition: wprt.cc:41
Enum< rfsv::errs > getStatus()
Retrieves the current status of the connection.
Definition: wprt.cc:72
const char * getConnectName()
Definition: wprt.cc:78
Enum< rfsv::errs > getData(bufferStore &buf)
Get Print Data.
Definition: wprt.cc:128