2003-11-20 02:49:41 +08:00
|
|
|
/* transport_pipes.h
|
2003-10-22 18:04:11 +08:00
|
|
|
|
2003-11-20 02:49:41 +08:00
|
|
|
Copyright 2001, 2002, 2003 Red Hat Inc.
|
2003-10-22 18:04:11 +08:00
|
|
|
|
|
|
|
Written by Robert Collins <rbtcollins@hotmail.com>
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
2003-11-20 02:49:41 +08:00
|
|
|
#ifndef _TRANSPORT_PIPES_H
|
|
|
|
#define _TRANSPORT_PIPES_H
|
2003-10-22 18:04:11 +08:00
|
|
|
|
2009-10-31 21:24:43 +08:00
|
|
|
#define PIPE_NAME_PREFIX L"\\\\.\\pipe\\cygwin-"
|
|
|
|
#define PIPE_NAME_SUFFIX L"-lpc"
|
|
|
|
|
2003-10-22 18:04:11 +08:00
|
|
|
/* Named pipes based transport, for security on NT */
|
|
|
|
class transport_layer_pipes : public transport_layer_base
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
#ifndef __INSIDE_CYGWIN__
|
|
|
|
virtual int listen ();
|
|
|
|
virtual class transport_layer_pipes *accept (bool *recoverable);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
virtual void close ();
|
|
|
|
virtual ssize_t read (void *buf, size_t len);
|
|
|
|
virtual ssize_t write (void *buf, size_t len);
|
|
|
|
virtual int connect ();
|
|
|
|
|
|
|
|
#ifndef __INSIDE_CYGWIN__
|
2003-11-20 02:49:41 +08:00
|
|
|
virtual bool impersonate_client ();
|
|
|
|
virtual bool revert_to_self ();
|
2003-10-22 18:04:11 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
transport_layer_pipes ();
|
|
|
|
virtual ~transport_layer_pipes ();
|
|
|
|
|
|
|
|
private:
|
2009-10-31 21:24:43 +08:00
|
|
|
wchar_t _pipe_name[40];
|
2003-10-22 18:04:11 +08:00
|
|
|
HANDLE _hPipe;
|
|
|
|
const bool _is_accepted_endpoint;
|
|
|
|
bool _is_listening_endpoint;
|
|
|
|
|
|
|
|
transport_layer_pipes (HANDLE hPipe);
|
|
|
|
};
|
|
|
|
|
2003-11-20 02:49:41 +08:00
|
|
|
#endif /* _TRANSPORT_PIPES_H */
|