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 | |
---|
| 29 | |
---|
| 30 | // A rule. |
---|
| 31 | // All entrys may be NULL to indicate not to compare them. |
---|
| 32 | // The only option is addr_use_inet_port which is used to disable checking of |
---|
| 33 | // the remote IP. |
---|
| 34 | struct roar_acl_rule { |
---|
| 35 | pid_t * pid; |
---|
| 36 | uid_t * uid; |
---|
[348] | 37 | gid_t * gid; |
---|
[345] | 38 | char * username; |
---|
| 39 | int * cookie; |
---|
| 40 | struct sockaddr * addr; |
---|
| 41 | socklen_t addrlen; |
---|
| 42 | int addr_use_inet_port; |
---|
| 43 | }; |
---|
| 44 | |
---|
[344] | 45 | #endif |
---|
| 46 | |
---|
| 47 | //ll |
---|
Note: See
TracBrowser
for help on using the repository browser.