add winpcap 4.0.2 from url http://www.winpcap.org/
[natblaster.git] / src / peer / directconn.h
blob95cf977b2423760ff40f2fdf371d47ffac0019ea
1 /*****************************************************************************
2 * Copyright 2005 Daniel Ferullo *
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 *****************************************************************************/
18 /**
19 * @file directconn.h
20 * @author Daniel Ferullo (ferullo@cmu.edu)
22 * @brief functions to help in attempt to make direct connection
25 #ifndef __DIRECTCONN_H__
26 #define __DIRECTCONN_H__
28 #include "errorcodes.h"
29 #include "peerdef.h"
31 /** @brief structure to hold argument to started direct connection thread */
32 struct direct_conn_connect_arg {
33 /** @brief the peer's info struct */
34 peer_conn_info_t *info;
35 } __attribute__((packed));
37 /** @brief typedef for the direct_conn_connect_arg structure */
38 typedef struct direct_conn_connect_arg direct_conn_connect_arg_t;
40 /**
41 * @brief starts the direct connection process by creating a detached thread
42 * to make the connection
44 * Allocates a direct_conn_arg_t structure that it expects the started thread
45 * to free.
47 * @param info pointer to the peer_conn_info_t structure will all the info
49 * @return SUCCESS, errorcode on failure
51 errorcode start_direct_conn(peer_conn_info_t *info);
53 #endif /* __DIRECTCONN_H__ */