176fd607bSopenharmony_ci/*
276fd607bSopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
376fd607bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
476fd607bSopenharmony_ci * you may not use this file except in compliance with the License.
576fd607bSopenharmony_ci * You may obtain a copy of the License at
676fd607bSopenharmony_ci *
776fd607bSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
876fd607bSopenharmony_ci *
976fd607bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1076fd607bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1176fd607bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1276fd607bSopenharmony_ci * See the License for the specific language governing permissions and
1376fd607bSopenharmony_ci * limitations under the License.
1476fd607bSopenharmony_ci *
1576fd607bSopenharmony_ci * epfs.h, keep same with fs/epfs/epfs.h
1676fd607bSopenharmony_ci *
1776fd607bSopenharmony_ci */
1876fd607bSopenharmony_ci
1976fd607bSopenharmony_ci#ifndef OHOS_FILEMANAGEMENT_EPFS_H
2076fd607bSopenharmony_ci#define OHOS_FILEMANAGEMENT_EPFS_H
2176fd607bSopenharmony_ci
2276fd607bSopenharmony_ci#include <cstdint>
2376fd607bSopenharmony_ci#include <sys/ioctl.h>
2476fd607bSopenharmony_ci
2576fd607bSopenharmony_cinamespace OHOS {
2676fd607bSopenharmony_cinamespace Media {
2776fd607bSopenharmony_ciconstexpr uint64_t PRIVACY_MAX_RANGES = 127;
2876fd607bSopenharmony_ci
2976fd607bSopenharmony_cistruct __attribute__((packed)) FilterProxyRanges {
3076fd607bSopenharmony_ci    uint64_t size;
3176fd607bSopenharmony_ci    uint64_t reserved; // reserve more space
3276fd607bSopenharmony_ci    struct {
3376fd607bSopenharmony_ci        uint64_t begin;
3476fd607bSopenharmony_ci        uint64_t end;
3576fd607bSopenharmony_ci    } range[0];
3676fd607bSopenharmony_ci};
3776fd607bSopenharmony_ci
3876fd607bSopenharmony_ci#define EPFS_IOCTL_MAGIC                  0x71
3976fd607bSopenharmony_ci#define IOC_SET_ORIGIN_FD                 _IOW(EPFS_IOCTL_MAGIC, 1, int32_t)
4076fd607bSopenharmony_ci#define IOC_SET_FILTER_PROXY_RANGE        _IOW(EPFS_IOCTL_MAGIC, 2, FilterProxyRanges)
4176fd607bSopenharmony_ci#define EPFS_IOCTL_MAXNR 3
4276fd607bSopenharmony_ci} // namespace Media
4376fd607bSopenharmony_ci} // namespace OHOS
4476fd607bSopenharmony_ci#endif // OHOS_FILEMANAGEMENT_EPFS_H
45