1 #ifndef LIGHTNING_CONNECTD_HANDSHAKE_H
2 #define LIGHTNING_CONNECTD_HANDSHAKE_H
3 #include "config.h"
4 
5 struct crypto_state;
6 struct io_conn;
7 struct wireaddr_internal;
8 struct pubkey;
9 
10 #define initiator_handshake(conn, my_id, their_id, addr, cb, cbarg)	\
11 	initiator_handshake_((conn), (my_id), (their_id), (addr),	\
12 			     typesafe_cb_preargs(struct io_plan *, void *, \
13 						 (cb), (cbarg),		\
14 						 struct io_conn *,	\
15 						 const struct pubkey *,	\
16 						 const struct wireaddr_internal *,	\
17 						 struct crypto_state *), \
18 			     (cbarg))
19 
20 
21 struct io_plan *initiator_handshake_(struct io_conn *conn,
22 				     const struct pubkey *my_id,
23 				     const struct pubkey *their_id,
24 				     const struct wireaddr_internal *addr,
25 				     struct io_plan *(*cb)(struct io_conn *,
26 							   const struct pubkey *,
27 							   const struct wireaddr_internal *,
28 							   struct crypto_state *,
29 							   void *cbarg),
30 				     void *cbarg);
31 
32 
33 #define responder_handshake(conn, my_id, addr, cb, cbarg)		\
34 	responder_handshake_((conn), (my_id), (addr),			\
35 			     typesafe_cb_preargs(struct io_plan *, void *, \
36 						 (cb), (cbarg),		\
37 						 struct io_conn *,	\
38 						 const struct pubkey *,	\
39 						 const struct wireaddr_internal *,	\
40 						 struct crypto_state *), \
41 			     (cbarg))
42 
43 struct io_plan *responder_handshake_(struct io_conn *conn,
44 				     const struct pubkey *my_id,
45 				     const struct wireaddr_internal *addr,
46 				     struct io_plan *(*cb)(struct io_conn *,
47 							   const struct pubkey *,
48 							   const struct wireaddr_internal *,
49 							   struct crypto_state *,
50 							   void *cbarg),
51 				     void *cbarg);
52 #endif /* LIGHTNING_CONNECTD_HANDSHAKE_H */
53