1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SOCKET_PARAMS_H
17 #define SOCKET_PARAMS_H
18 
19 #include <cstdint>
20 
21 #include "intention_identity.h"
22 
23 namespace OHOS {
24 namespace Msdp {
25 namespace DeviceStatus {
26 enum SocketAction : uint32_t {
27     SOCKET_ACTION_UNKNOWN,
28     SOCKET_ACTION_CONNECT,
29 };
30 
31 struct AllocSocketPairParam final : public ParamBase {
32     AllocSocketPairParam() = default;
33     AllocSocketPairParam(const std::string &programName, int32_t moduleType);
34     bool Marshalling(MessageParcel &parcel) const override;
35     bool Unmarshalling(MessageParcel &parcel) override;
36 
37     std::string programName;
38     int32_t moduleType { -1 };
39 };
40 
41 struct AllocSocketPairReply final : public ParamBase {
42     AllocSocketPairReply() = default;
43     AllocSocketPairReply(int32_t tokenType, int32_t socketFd);
44     bool Marshalling(MessageParcel &parcel) const override;
45     bool Unmarshalling(MessageParcel &parcel) override;
46 
47     int32_t tokenType { -1 };
48     int32_t socketFd { -1 };
49 };
50 } // namespace DeviceStatus
51 } // namespace Msdp
52 } // namespace OHOS
53 #endif // SOCKET_PARAMS_H