Remove the TIZEN_FEATURE_ASP build flag
[platform/core/connectivity/wifi-direct-manager.git] / include / wifi-direct-session.h
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 /**
21  * This file declares wifi direct session functions and structures.
22  *
23  * @file                wifi-direct-session.h
24  * @author      Gibyoung Kim (lastkgb.kim@samsung.com)
25  * @version     0.7
26  */
27
28 #ifndef __WIFI_DIRECT_SESSION_H__
29 #define __WIFI_DIRECT_SESSION_H__
30
31 typedef enum {
32         SESSION_TYPE_NORMAL,
33         SESSION_TYPE_INVITE,
34         SESSION_TYPE_JOIN,
35         SESSION_TYPE_MULTI,
36         SESSION_TYPE_ASP,
37 } session_type_e;
38
39 typedef enum {
40         SESSION_STATE_CREATED,
41         SESSION_STATE_STARTED,
42         SESSION_STATE_GO_NEG,
43         SESSION_STATE_WPS,
44         SESSION_STATE_KEY_NEG,
45         SESSION_STATE_COMPLETED,
46         SESSION_STATE_STOPPED,
47 } session_state_e;
48
49 typedef enum {
50         SESSION_DIRECTION_INCOMING,
51         SESSION_DIRECTION_OUTGOING,
52 } session_direction_e;
53
54 typedef struct {
55         int type;
56         int state;
57         int timer;
58         int connecting_120;
59         unsigned int retry_gsrc;
60         int direction;
61         wfd_device_s *peer;
62         int wps_mode;
63         int req_wps_mode;
64         int go_intent;
65         int freq;
66         char wps_pin[PINSTR_LEN+1];
67         unsigned int session_id;
68         unsigned char service_mac[MACADDR_LEN];
69         unsigned char session_mac[MACADDR_LEN];
70 } wfd_session_s;
71
72 wfd_session_s *wfd_create_session(void *data, unsigned char *peer_addr, int wps_mode, int direction);
73 int wfd_destroy_session(void *data);
74 int wfd_session_start(wfd_session_s *session);
75 int wfd_session_connect(wfd_session_s *session);
76 int wfd_session_cancel(wfd_session_s *session, unsigned char *peer_addr);
77 int wfd_session_reject(wfd_session_s *session, unsigned char *peer_addr);
78 int wfd_session_wps(wfd_session_s *session);
79 int wfd_session_invite(wfd_session_s *session);
80 int wfd_session_join(wfd_session_s *session);
81 wfd_device_s *wfd_session_get_peer(wfd_session_s *session);
82 unsigned char *wfd_session_get_peer_addr(wfd_session_s *session);
83 #if 0
84 int wfd_session_get_state(wfd_session_s *session);
85 int wfd_session_stop(wfd_session_s *session);
86 #endif
87 int wfd_session_complete(wfd_session_s *session);
88 int wfd_session_timer(wfd_session_s *session, int start);
89
90 int wfd_session_process_event(wfd_manager_s *manager, wfd_oem_event_s *event);
91 int wfd_session_asp_session_start(wfd_session_s *session, wfd_oem_asp_prov_s *params);
92 int wfd_session_asp_connect(wfd_session_s *session, int role);
93 int wfd_session_asp_persistent_connect(wfd_session_s *session, int persist_group_id);
94
95 #endif /* __WIFI_DIRECT_SESSION_H__ */