1 /*
2  * barrier -- mouse and keyboard sharing utility
3  * Copyright (C) 2012-2016 Symless Ltd.
4  * Copyright (C) 2012 Nick Bolton
5  *
6  * This package is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * found in the file LICENSE that should have accompanied this file.
9  *
10  * This package is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #define IPC_HOST "127.0.0.1"
22 #define IPC_PORT 24801
23 
24 enum EIpcMessage {
25     kIpcHello,
26     kIpcLogLine,
27     kIpcCommand,
28     kIpcShutdown,
29 };
30 
31 enum EIpcClientType {
32     kIpcClientUnknown,
33     kIpcClientGui,
34     kIpcClientNode,
35 };
36 
37 // handshake: node/gui -> daemon
38 // $1 = type, the client identifies it's self as gui or node (barrierc/s).
39 extern const char*        kIpcMsgHello;
40 
41 // log line: daemon -> gui
42 // $1 = aggregate log lines collected from barriers/c or the daemon itself.
43 extern const char*        kIpcMsgLogLine;
44 
45 // command: gui -> daemon
46 // $1 = command; the command for the daemon to launch, typically the full
47 // path to barriers/c. $2 = true when process must be elevated on ms windows.
48 extern const char*        kIpcMsgCommand;
49 
50 // shutdown: daemon -> node
51 // the daemon tells barriers/c to shut down gracefully.
52 extern const char*        kIpcMsgShutdown;
53