blob: e6d61e639066faa94781e75025a9262ed7cca991 [file] [log] [blame]
Ashish Sharma8626cce2011-07-07 18:16:01 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef __CUTILS_QTAGUID_H
18#define __CUTILS_QTAGUID_H
19
20#include <stdint.h>
21#include <sys/types.h>
Ashish Sharma6dce8322011-07-10 13:57:05 -070022#include <unistd.h>
Ashish Sharma8626cce2011-07-07 18:16:01 -070023
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/*
29 * Set tags (and owning UIDs) for network sockets.
30*/
Ashish Sharma9b5c7742011-08-03 00:31:19 -070031extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid);
32
33/*
34 * Untag a network socket before closing.
35*/
36extern int qtaguid_untagSocket(int sockfd);
Ashish Sharma8626cce2011-07-07 18:16:01 -070037
38#ifdef __cplusplus
39}
40#endif
41
42#endif /* __CUTILS_QTAG_UID_H */