source: roaraudio/include/roaraudio/acl.h @ 704:25764dfdef62

Last change on this file since 704:25764dfdef62 was 704:25764dfdef62, checked in by phi, 16 years ago

added COPYING.lgplv3

File size: 2.2 KB
Line 
1//acl.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008
5 *
6 *  This file is part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU Lesser General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  RoarAudio is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU Lesser General Public License for more details.
18 *
19 *  You should have received a copy of the GNU Lesser General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 *  NOTE: Even though this file is LGPLed it (may) include GPLed files
24 *  so the license of this file is/may therefore downgraded to GPL.
25 *  See HACKING for details.
26 */
27
28#ifndef _ROARAUDIO_ACL_H_
29#define _ROARAUDIO_ACL_H_
30
31// basic rule constants
32#define ROAR_ACL_DENY      0
33#define ROAR_ACL_REJECT    ROAR_ACL_DENY
34#define ROAR_ACL_ALLOW     1
35#define ROAR_ACL_ALLOW_OWN 2
36
37struct roar_acl_target {
38 int connect;
39 int stream;
40 int connect_to;
41 int exit;
42 int standby;
43 int kick;
44 int list;
45 int meta;
46 int volume;
47 int get_client;
48 int get_stream;
49 int beep;
50};
51
52#define ROAR_ACL_CHK(r,w,o) (( ((r)->w) == ROAR_ACL_ALLOW || (((r)->w) == ROAR_ACL_ALLOW_OWN && (o)) ) ? 1 : 0)
53
54#define ROAR_ACL_CMP_NOT     0x10
55#define ROAR_ACL_CMP_EQ      0x01
56
57#define ROAR_ACL_TYPE_ID     1
58#define ROAR_ACL_TYPE_INT    1
59#define ROAR_ACL_TYPE_VOID   1
60
61struct roar_acl_cmp {
62 int op;
63 int type;
64 union {
65  id_t   id;
66  int    i;
67  void * p;
68 } data;
69 int datalen;
70};
71
72// A rule.
73// All entrys may be NULL to indicate not to compare them.
74// The only option is addr_use_inet_port which is used to disable checking of
75// the remote IP.
76struct roar_acl_rule {
77 pid_t           * pid;
78 uid_t           * uid;
79 gid_t           * gid;
80 char            * username;
81 int             * cookie;
82 struct sockaddr * addr;
83 socklen_t         addrlen;
84 int               addr_use_inet_port;
85};
86
87#endif
88
89//ll
Note: See TracBrowser for help on using the repository browser.