f8550fda83b253b49c1d82f335112c60c3d5a62a
2 * Copyright (C) 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CUTILS_QTAGUID_H
18 #define __CUTILS_QTAGUID_H
21 #include <sys/types.h>
29 * Set tags (and owning UIDs) for network sockets.
31 extern int qtaguid_tagSocket(int sockfd
, int tag
, uid_t uid
);
34 * Untag a network socket before closing.
36 extern int qtaguid_untagSocket(int sockfd
);
39 * For the given uid, switch counter sets.
40 * The kernel only keeps a limited number of sets.
43 extern int qtaguid_setCounterSet(int counterSetNum
, uid_t uid
);
46 * Delete all tag info that relates to the given tag an uid.
47 * If the tag is 0, then ALL info about the uid is freeded.
48 * The delete data also affects active tagged socketd, which are
50 * The calling process can only operate on its own tags.
51 * Unless it is part of the happy AID_NET_BW_ACCT group.
52 * In which case it can clobber everything.
54 extern int qtaguid_deleteTagData(int tag
, uid_t uid
);
57 * Enable/disable qtaguid functionnality at a lower level.
58 * When pacified, the kernel will accept commands but do nothing.
60 extern int qtaguid_setPacifier(int on
);
66 #endif /* __CUTILS_QTAG_UID_H */