Files
MattKCandMattKC 61e2a91028 Implement Polkit agent for platforms that lack them (#244)
* attempt to set up polkit listener

* implement polkit agent functionality

* finalized polkit implementation

* add warning for installing polkit rule

* docker: install libpolkit-agent-1-dev

* add uninstall polkit option

---------

Co-authored-by: MattKC <[email protected]>
2025-10-03 16:25:00 -07:00

48 lines
1.3 KiB
C

#ifndef VANILLA_PIPE_DEF_H
#define VANILLA_PIPE_DEF_H
#include <vanilla.h>
#define VANILLA_PIPE_CMD_SERVER_PORT 51000
#define VANILLA_PIPE_CMD_CLIENT_PORT 51100
#define VANILLA_PIPE_CC_SYNC 0x80
#define VANILLA_PIPE_CC_CONNECT 0x81
#define VANILLA_PIPE_CC_BIND_ACK 0x82
#define VANILLA_PIPE_CC_STATUS 0x83
#define VANILLA_PIPE_CC_PING 0x84
#define VANILLA_PIPE_CC_BUSY 0x85
#define VANILLA_PIPE_CC_UNBIND 0x86
#define VANILLA_PIPE_CC_SYNC_SUCCESS 0x87
#define VANILLA_PIPE_CC_CONNECTED 0x88
#define VANILLA_PIPE_CC_DISCONNECTED 0x89
#define VANILLA_PIPE_CC_INSTALL_POLKIT 0x8A
#define VANILLA_PIPE_CC_UNINSTALL_POLKIT 0x8B
#define VANILLA_PIPE_CC_QUIT 0x90
#define VANILLA_PIPE_LOCAL_SOCKET "/tmp/vanilla-pipe_%i.sock"
#define POLKIT_ACTION_DST "/usr/share/polkit-1/actions/com.mattkc.vanilla.policy"
#define POLKIT_RULE_DST "/usr/share/polkit-1/rules.d/com.mattkc.vanilla.rules"
#pragma pack(push, 1)
typedef struct {
uint16_t code;
} vanilla_pipe_sync_info_t;
typedef struct {
int32_t status;
} vanilla_pipe_status_info_t;
typedef struct {
uint8_t control_code;
union{
vanilla_pipe_sync_info_t sync;
vanilla_connection_t connection;
vanilla_pipe_status_info_t status;
};
} vanilla_pipe_command_t;
#pragma pack(pop)
#endif // VANILLA_PIPE_DEF_H