Rev | Line | |
---|
[344] | 1 | //acl.h: |
---|
| 2 | |
---|
| 3 | #ifndef _ROARAUDIO_ACL_H_ |
---|
| 4 | #define _ROARAUDIO_ACL_H_ |
---|
| 5 | |
---|
[345] | 6 | // basic rule constants |
---|
| 7 | #define ROAR_ACL_DENY 0 |
---|
| 8 | #define ROAR_ACL_REJECT ROAR_ACL_DENY |
---|
| 9 | #define ROAR_ACL_ALLOW 1 |
---|
| 10 | #define ROAR_ACL_ALLOW_OWN 2 |
---|
| 11 | |
---|
| 12 | struct roar_acl_target { |
---|
| 13 | int connect; |
---|
| 14 | int stream; |
---|
| 15 | int connect_to; |
---|
| 16 | int exit; |
---|
| 17 | int standby; |
---|
| 18 | int kick; |
---|
| 19 | int list; |
---|
| 20 | int meta; |
---|
| 21 | int volume; |
---|
| 22 | int get_client; |
---|
| 23 | int get_stream; |
---|
| 24 | int beep; |
---|
| 25 | }; |
---|
| 26 | |
---|
| 27 | #define ROAR_ACL_CHK(r,w,o) (( ((r)->w) == ROAR_ACL_ALLOW || (((r)->w) == ROAR_ACL_ALLOW_OWN && (o)) ) ? 1 : 0) |
---|
| 28 | |
---|
[489] | 29 | #define ROAR_ACL_CMP_NOT 0x10 |
---|
| 30 | #define ROAR_ACL_CMP_EQ 0x01 |
---|
| 31 | |
---|
| 32 | #define ROAR_ACL_TYPE_ID 1 |
---|
| 33 | #define ROAR_ACL_TYPE_INT 1 |
---|
| 34 | #define ROAR_ACL_TYPE_VOID 1 |
---|
| 35 | |
---|
| 36 | struct roar_acl_cmp { |
---|
| 37 | int op; |
---|
| 38 | int type; |
---|
| 39 | union { |
---|
| 40 | id_t id; |
---|
| 41 | int i; |
---|
| 42 | void * p; |
---|
| 43 | } data; |
---|
| 44 | int datalen; |
---|
| 45 | }; |
---|
[345] | 46 | |
---|
| 47 | // A rule. |
---|
| 48 | // All entrys may be NULL to indicate not to compare them. |
---|
| 49 | // The only option is addr_use_inet_port which is used to disable checking of |
---|
| 50 | // the remote IP. |
---|
| 51 | struct roar_acl_rule { |
---|
| 52 | pid_t * pid; |
---|
| 53 | uid_t * uid; |
---|
[348] | 54 | gid_t * gid; |
---|
[345] | 55 | char * username; |
---|
| 56 | int * cookie; |
---|
| 57 | struct sockaddr * addr; |
---|
| 58 | socklen_t addrlen; |
---|
| 59 | int addr_use_inet_port; |
---|
| 60 | }; |
---|
| 61 | |
---|
[344] | 62 | #endif |
---|
| 63 | |
---|
| 64 | //ll |
---|
Note: See
TracBrowser
for help on using the repository browser.