00001 /* 00002 ** holder.h for lseos in /home/anoman/work/lse/lseos/lseos-srv/net/inet 00003 ** 00004 ** Copyright (c)2004 Arthur Kopatsy 00005 ** Login <kopats_a@epita.fr> 00006 ** 00007 ** Started on Mon Nov 29 09:57:56 2004 Arthur Kopatsy 00008 ** Last update Mon Nov 29 11:15:28 2004 Arthur Kopatsy 00009 */ 00010 00011 #ifndef HOLDER_H_ 00012 #define HOLDER_H_ 00013 00014 /* 00015 ** There is one holder group per socket. group id is supposed to be 00016 ** unique. 00017 */ 00018 00019 struct s_holder 00020 { 00021 TAILQ_ENTRY(s_holder) next; 00022 pid_t pid; 00023 uid_t uid; 00024 }; 00025 00026 struct s_holder_group 00027 { 00028 int64_t id; 00029 TAILQ_ENTRY(s_holder_group) next; 00030 TAILQ_HEAD(s_holder_head, s_holder) holders; 00031 }; 00032 00033 TAILQ_HEAD(s_holder_groups_head, s_holder_group); 00034 00035 /* PROTO holder.c */ 00036 #ifdef __INET__ 00037 /* holder.c */ 00038 int64_t add_holder_group(void); 00039 int add_holder(int64_t id, pid_t pid, uid_t uid); 00040 int is_uid_in_group(int64_t id, uid_t uid); 00041 int is_pid_in_group(int64_t id, pid_t pid); 00042 int kill_holder_group(int64_t id); 00043 int remove_holder(int64_t id, pid_t pid); 00044 int remove_holder_group(int64_t id); 00045 #endif /* __INET__ */ 00046 #endif