Changeset 1085 for pjproject/trunk/pjnath/include/pjnath/ice.h
- Timestamp:
- Mar 20, 2007 8:44:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/ice.h
r1080 r1085 25 25 */ 26 26 #include <pjnath/types.h> 27 #include <pjnath/stun_ endpoint.h>27 #include <pjnath/stun_session.h> 28 28 #include <pjlib-util/resolver.h> 29 29 #include <pj/sock.h> … … 65 65 66 66 67 #define PJ_ICE_MAX_CAND 3267 #define PJ_ICE_MAX_CAND 16 68 68 #define PJ_ICE_MAX_COMP 8 69 69 #define PJ_ICE_MAX_CHECKS 32 70 70 71 71 /** … … 105 105 typedef struct pj_ice_check 106 106 { 107 unsigned local_cand_id; 107 unsigned cand_id; 108 pj_uint32_t comp_id; 109 pj_str_t foundation; 110 108 111 pj_uint64_t check_prio; 109 112 pj_ice_check_state check_state; … … 128 131 pj_ice_checklist_state state; 129 132 unsigned count; 130 pj_ice_check *checks;133 pj_ice_check checks[PJ_ICE_MAX_CHECKS]; 131 134 } pj_ice_checklist; 132 135 … … 137 140 typedef struct pj_ice_cb 138 141 { 139 pj_ bool_t (*on_found_cand)(pj_ice *sock,140 pj_ice_cand_type type,141 const pj_sockaddr_t * addr,142 intaddr_len);142 pj_status_t (*on_send_pkt)(pj_ice *ice, 143 const void *pkt, pj_size_t size, 144 const pj_sockaddr_t *dst_addr, 145 unsigned addr_len); 143 146 } pj_ice_cb; 144 147 … … 154 157 } pj_ice_state; 155 158 159 typedef enum pj_ice_role 160 { 161 PJ_ICE_ROLE_CONTROLLED, 162 PJ_ICE_ROLE_CONTROLLING 163 } pj_ice_role; 164 156 165 /** 157 166 * ICE structure. … … 165 174 int af; 166 175 int sock_type; 167 176 pj_ice_role role; 168 177 pj_ice_state state; 178 179 pj_ice_cb cb; 180 181 /* STUN credentials */ 182 pj_str_t tx_uname; 183 pj_str_t tx_pass; 184 pj_str_t rx_uname; 185 pj_str_t rx_pass; 169 186 170 187 /* Components */ … … 173 190 174 191 /* Local candidates */ 175 unsigned cand_cnt; 176 pj_ice_cand cand[PJ_ICE_MAX_CAND]; 177 178 /* Checklist */ 192 unsigned lcand_cnt; 193 pj_ice_cand lcand[PJ_ICE_MAX_CAND]; 194 195 /* Remote candidates */ 196 unsigned rcand_cnt; 197 pj_ice_cand rcand[PJ_ICE_MAX_CAND]; 198 199 /* Checklists */ 179 200 pj_ice_checklist cklist; 201 pj_ice_checklist valid_list; 180 202 181 203 /* STUN servers */ … … 184 206 pj_bool_t relay_enabled; 185 207 pj_sockaddr stun_srv; 208 209 /* STUN sessions */ 210 pj_stun_session *tx_sess; 211 pj_stun_session *rx_sess; 186 212 }; 187 213 … … 189 215 PJ_DECL(pj_status_t) pj_ice_create(pj_stun_config *cfg, 190 216 const char *name, 217 pj_ice_role role, 218 const pj_ice_cb *cb, 191 219 int af, 192 220 int sock_type, … … 208 236 unsigned comp_id, 209 237 pj_sock_t sock); 210 238 PJ_DECL(pj_status_t) pj_ice_set_credentials(pj_ice *ice, 239 const pj_str_t *local_ufrag, 240 const pj_str_t *local_pass, 241 const pj_str_t *remote_ufrag, 242 const pj_str_t *remote_pass); 211 243 PJ_DECL(pj_status_t) pj_ice_start_gather(pj_ice *ice, 212 244 unsigned flags);
Note: See TracChangeset
for help on using the changeset viewer.