Lines Matching defs:iceConn
60 IceDisposeCompleteMessage (iceConn, _pStart); \
171 IceConn iceConn,
189 iceConn->dispatch_level++;
196 if (!_IceRead (iceConn, (unsigned long) SIZEOF (iceMsg), iceConn->inbuf))
207 if (!iceConn->io_ok)
215 iceConn->dispatch_level--;
216 iceConn->connection_status = IceConnectIOError;
220 header = (iceMsg *) iceConn->inbuf;
221 iceConn->inbufptr = iceConn->inbuf + SIZEOF (iceMsg);
223 iceConn->receive_sequence++;
225 if (iceConn->waiting_for_byteorder)
233 CHECK_SIZE_MATCH (iceConn, ICE_ByteOrder,
239 _IceErrorBadValue (iceConn, 0,
242 iceConn->connection_status = IceConnectRejected;
246 iceConn->swap =
250 iceConn->waiting_for_byteorder = 0;
257 _IceErrorBadMajor (iceConn, header->majorOpcode,
262 _IceErrorBadState (iceConn, 0,
266 iceConn->connection_status = IceConnectRejected;
269 iceConn->dispatch_level--;
270 if (!iceConn->io_ok)
272 iceConn->connection_status = IceConnectIOError;
279 if (iceConn->swap)
293 _IceAddReplyWait (iceConn, replyWait);
317 int idx = header->majorOpcode - iceConn->his_min_opcode;
318 op = iceConn->process_msg_info[idx].my_opcode;
320 useThisReplyWait = _IceSearchReplyWaits (iceConn, op);
333 _IceVersions[iceConn->my_ice_version_index].process_core_msg_proc;
335 (*processIce) (iceConn, header->minorOpcode,
336 header->length, iceConn->swap,
354 if ((int) header->majorOpcode < iceConn->his_min_opcode ||
355 (int) header->majorOpcode > iceConn->his_max_opcode ||
356 !(iceConn->process_msg_info[header->majorOpcode -
357 iceConn->his_min_opcode].in_use))
363 _IceErrorBadMajor (iceConn, header->majorOpcode,
366 _IceReadSkip (iceConn, header->length << 3);
370 _IceProcessMsgInfo *processMsgInfo = &iceConn->process_msg_info[
371 header->majorOpcode - iceConn->his_min_opcode];
378 (*processProc) (iceConn, processMsgInfo->client_data,
379 header->minorOpcode, header->length, iceConn->swap);
386 (*processProc) (iceConn,
388 header->length, iceConn->swap,
396 _IceSetReplyReady (iceConn, useThisReplyWait);
407 *replyReadyRet = _IceCheckReplyReady (iceConn, replyWait);
416 iceConn->dispatch_level--;
418 if (iceConn->dispatch_level == 0 && iceConn->free_asap)
420 _IceFreeConnection (iceConn);
423 else if (!iceConn->io_ok)
425 iceConn->connection_status = IceConnectIOError;
436 IceConn iceConn,
444 IceGetHeader (iceConn, 0, ICE_AuthRequired,
453 IceWriteData (iceConn, authDataLen, (char *) authData);
456 IceWritePad (iceConn, PAD64 (authDataLen));
459 IceFlush (iceConn);
466 IceConn iceConn,
473 IceGetHeader (iceConn, 0, ICE_AuthReply,
479 IceWriteData (iceConn, authDataLen, (char *) authData);
482 IceWritePad (iceConn, PAD64 (authDataLen));
484 IceFlush (iceConn);
491 IceConn iceConn,
498 IceGetHeader (iceConn, 0, ICE_AuthNextPhase,
504 IceWriteData (iceConn, authDataLen, (char *) authData);
507 IceWritePad (iceConn, PAD64 (authDataLen));
509 IceFlush (iceConn);
516 IceConn iceConn,
526 IceGetHeaderExtra (iceConn, 0, ICE_ConnectionReply,
536 IceFlush (iceConn);
538 SEND_STRING (iceConn, IceVendorString);
539 SEND_STRING (iceConn, IceReleaseString);
542 iceConn->connection_status = IceConnectAccepted;
549 IceConn iceConn,
563 IceGetHeaderExtra (iceConn, 0, ICE_ProtocolReply,
574 IceFlush (iceConn);
576 SEND_STRING (iceConn, vendor);
577 SEND_STRING (iceConn, release);
587 _IceAddOpcodeMapping (iceConn, hisOpcode, myOpcode);
594 IceConn iceConn
597 IceSimpleMessage (iceConn, 0, ICE_PingReply);
598 IceFlush (iceConn);
605 IceConn iceConn,
617 CHECK_AT_LEAST_SIZE (iceConn, ICE_Error,
619 (iceConn->connect_to_you || iceConn->connect_to_me) ?
622 IceReadCompleteMessage (iceConn, SIZEOF (iceErrorMsg),
625 if (!IceValidIO (iceConn) || pStart == NULL)
627 IceDisposeCompleteMessage (iceConn, pStart);
636 _IceErrorBadValue (iceConn, 0,
638 IceDisposeCompleteMessage (iceConn, pStart);
657 if (iceConn->connect_to_you &&
658 ((!iceConn->connect_to_you->auth_active &&
660 (iceConn->connect_to_you->auth_active &&
728 else if (iceConn->protosetup_to_you &&
729 ((!iceConn->protosetup_to_you->auth_active &&
731 (iceConn->protosetup_to_you->auth_active &&
833 if (iceConn->connect_to_you &&
834 iceConn->connect_to_you->auth_active)
837 (iceConn->connect_to_you->my_auth_index)];
839 (*authProc) (iceConn, &iceConn->connect_to_you->my_auth_state,
843 else if (iceConn->protosetup_to_you &&
844 iceConn->protosetup_to_you->auth_active)
847 iceConn->protosetup_to_you->my_opcode - 1].orig_client;
849 authProc = protocol->auth_procs[(int)(iceConn->
852 (*authProc) (iceConn,
853 &iceConn->protosetup_to_you->my_auth_state,
862 (*_IceErrorHandler) (iceConn, swap, message->offendingMinorOpcode,
867 IceDisposeCompleteMessage (iceConn, pStart);
876 IceConn iceConn,
900 CHECK_AT_LEAST_SIZE (iceConn, ICE_ConnectionSetup,
903 IceReadCompleteMessage (iceConn, SIZEOF (iceConnectionSetupMsg),
906 if (!IceValidIO (iceConn) || pStart == NULL)
908 IceDisposeCompleteMessage (iceConn, pStart);
916 BAIL_STRING(iceConn, ICE_ConnectionSetup,
919 BAIL_STRING(iceConn, ICE_ConnectionSetup,
922 BAIL_STRING(iceConn, ICE_ConnectionSetup,
927 CHECK_COMPLETE_SIZE (iceConn, ICE_ConnectionSetup,
934 _IceErrorBadValue (iceConn, 0,
936 iceConn->connection_status = IceConnectRejected;
937 IceDisposeCompleteMessage (iceConn, pStart);
984 _IceErrorNoVersion (iceConn, ICE_ConnectionSetup);
985 iceConn->connection_status = IceConnectRejected;
998 IceDisposeCompleteMessage (iceConn, pStart);
1002 _IceGetPaValidAuthIndices ("ICE", iceConn->connection_string,
1040 if (mustAuthenticate || !iceConn->listen_obj->host_based_auth_proc)
1042 _IceErrorNoAuthentication (iceConn, ICE_ConnectionSetup);
1043 iceConn->connection_status = IceConnectRejected;
1047 char *hostname = _IceGetPeerName (iceConn);
1049 if ((*iceConn->listen_obj->host_based_auth_proc) (hostname))
1055 _IceErrorAuthenticationRejected (iceConn,
1058 iceConn->connection_status = IceConnectRejected;
1064 if (iceConn->connection_status == IceConnectRejected)
1081 status = (*authProc) (iceConn, &authState,
1088 AuthRequired (iceConn, hisAuthIndex, authDataLen, authData);
1090 iceConn->connect_to_me = setupInfo =
1119 AcceptConnection (iceConn, hisVersionIndex);
1121 iceConn->vendor = vendor;
1122 iceConn->release = release;
1123 iceConn->my_ice_version_index = myVersionIndex;
1134 IceDisposeCompleteMessage (iceConn, pStart);
1142 IceConn iceConn,
1159 CHECK_AT_LEAST_SIZE (iceConn, ICE_AuthRequired,
1161 iceConn->connect_to_you ? IceFatalToConnection : IceFatalToProtocol);
1163 IceReadCompleteMessage (iceConn, SIZEOF (iceAuthRequiredMsg),
1166 if (!IceValidIO (iceConn) || authData == NULL)
1168 IceDisposeCompleteMessage (iceConn, authData);
1177 CHECK_COMPLETE_SIZE (iceConn, ICE_AuthRequired, length,
1179 iceConn->connect_to_you ? IceFatalToConnection : IceFatalToProtocol);
1181 if (iceConn->connect_to_you)
1197 _IceErrorBadValue (iceConn, 0,
1200 IceDisposeCompleteMessage (iceConn, authData);
1207 iceConn->connect_to_you->auth_active = 1;
1210 else if (iceConn->protosetup_to_you)
1213 iceConn->protosetup_to_you->my_auth_count)
1227 _IceErrorBadValue (iceConn, 0,
1230 IceDisposeCompleteMessage (iceConn, authData);
1236 iceConn->protosetup_to_you->my_opcode - 1].orig_client;
1238 realAuthIndex = iceConn->protosetup_to_you->
1243 iceConn->protosetup_to_you->auth_active = 1;
1252 _IceErrorBadState (iceConn, 0, ICE_AuthRequired, IceCanContinue);
1254 IceDisposeCompleteMessage (iceConn, authData);
1261 status = (*authProc) (iceConn, &authState, False /* don't clean up */,
1266 AuthReply (iceConn, replyDataLen, replyData);
1268 replyWait->sequence_of_request = iceConn->send_sequence;
1271 if (iceConn->connect_to_you)
1273 iceConn->connect_to_you->my_auth_state = authState;
1274 iceConn->connect_to_you->my_auth_index = message->authIndex;
1276 else if (iceConn->protosetup_to_you)
1278 iceConn->protosetup_to_you->my_auth_state = authState;
1279 iceConn->protosetup_to_you->my_auth_index = realAuthIndex;
1289 _IceErrorAuthenticationRejected (iceConn,
1296 _IceErrorAuthenticationFailed (iceConn,
1306 if (iceConn->connect_to_you)
1327 IceDisposeCompleteMessage (iceConn, authData);
1336 IceConn iceConn,
1348 CHECK_AT_LEAST_SIZE (iceConn, ICE_AuthReply,
1350 iceConn->connect_to_me ? IceFatalToConnection : IceFatalToProtocol);
1352 IceReadCompleteMessage (iceConn, SIZEOF (iceAuthReplyMsg),
1355 if (!IceValidIO (iceConn) || replyData == NULL)
1357 IceDisposeCompleteMessage (iceConn, replyData);
1366 CHECK_COMPLETE_SIZE (iceConn, ICE_AuthReply, length,
1368 iceConn->connect_to_me ? IceFatalToConnection : IceFatalToProtocol);
1372 if (iceConn->connect_to_me)
1375 (iceConn->connect_to_me->my_auth_index)];
1377 (*authProc) (iceConn, &iceConn->connect_to_me->my_auth_state, swap,
1382 AuthNextPhase (iceConn, authDataLen, authData);
1392 if (!iceConn->connect_to_me->must_authenticate &&
1393 iceConn->listen_obj->host_based_auth_proc)
1395 char *hostname = _IceGetPeerName (iceConn);
1397 if ((*iceConn->listen_obj->host_based_auth_proc) (hostname))
1407 free (iceConn->connect_to_me->his_vendor);
1408 free (iceConn->connect_to_me->his_release);
1409 free (iceConn->connect_to_me);
1410 iceConn->connect_to_me = NULL;
1412 iceConn->connection_status = IceConnectRejected;
1416 _IceErrorAuthenticationRejected (iceConn,
1421 _IceErrorAuthenticationFailed (iceConn,
1429 AcceptConnection (iceConn,
1430 iceConn->connect_to_me->his_version_index);
1432 iceConn->vendor = iceConn->connect_to_me->his_vendor;
1433 iceConn->release = iceConn->connect_to_me->his_release;
1434 iceConn->my_ice_version_index =
1435 iceConn->connect_to_me->my_version_index;
1437 free (iceConn->connect_to_me);
1438 iceConn->connect_to_me = NULL;
1441 else if (iceConn->protosetup_to_me)
1443 _IcePaProtocol *myProtocol = _IceProtocols[iceConn->protosetup_to_me->
1446 (iceConn->protosetup_to_me->my_auth_index)];
1448 (*authProc) (iceConn, &iceConn->protosetup_to_me->my_auth_state,
1455 AuthNextPhase (iceConn, authDataLen, authData);
1466 if (!iceConn->protosetup_to_me->must_authenticate &&
1469 char *hostname = _IceGetPeerName (iceConn);
1481 _IceErrorAuthenticationRejected (iceConn,
1486 _IceErrorAuthenticationFailed (iceConn,
1510 setupStatus = (*protocolSetupProc) (iceConn,
1511 myProtocol->version_recs[iceConn->protosetup_to_me->
1513 myProtocol->version_recs[iceConn->protosetup_to_me->
1515 iceConn->protosetup_to_me->his_vendor,
1516 iceConn->protosetup_to_me->his_release,
1525 iceConn->protosetup_to_me->his_vendor = NULL;
1526 iceConn->protosetup_to_me->his_release = NULL;
1535 AcceptProtocol (iceConn,
1536 iceConn->protosetup_to_me->his_opcode,
1537 iceConn->protosetup_to_me->my_opcode,
1538 iceConn->protosetup_to_me->his_version_index,
1547 iceConn->protosetup_to_me->
1550 process_msg_info = &iceConn->process_msg_info[
1551 iceConn->protosetup_to_me->
1552 his_opcode -iceConn->his_min_opcode];
1565 iceConn->proto_ref_count++;
1577 (*protocolActivateProc) (iceConn,
1587 _IceErrorSetupFailed (iceConn, ICE_ProtocolSetup,
1597 free (iceConn->protosetup_to_me->his_vendor);
1598 free (iceConn->protosetup_to_me->his_release);
1599 free (iceConn->protosetup_to_me);
1600 iceConn->protosetup_to_me = NULL;
1609 _IceErrorBadState (iceConn, 0, ICE_AuthReply, IceCanContinue);
1618 IceDisposeCompleteMessage (iceConn, replyData);
1626 IceConn iceConn,
1642 CHECK_AT_LEAST_SIZE (iceConn, ICE_AuthNextPhase,
1644 iceConn->connect_to_you ? IceFatalToConnection : IceFatalToProtocol);
1646 IceReadCompleteMessage (iceConn, SIZEOF (iceAuthNextPhaseMsg),
1649 if (!IceValidIO (iceConn) || authData == NULL)
1651 IceDisposeCompleteMessage (iceConn, authData);
1660 CHECK_COMPLETE_SIZE (iceConn, ICE_AuthNextPhase, length,
1662 iceConn->connect_to_you ? IceFatalToConnection : IceFatalToProtocol);
1664 if (iceConn->connect_to_you)
1667 (iceConn->connect_to_you->my_auth_index)];
1669 authState = &iceConn->connect_to_you->my_auth_state;
1671 else if (iceConn->protosetup_to_you)
1674 _IceProtocols[iceConn->protosetup_to_you->my_opcode - 1].orig_client;
1677 (iceConn->protosetup_to_you->my_auth_index)];
1679 authState = &iceConn->protosetup_to_you->my_auth_state;
1687 _IceErrorBadState (iceConn, 0, ICE_AuthNextPhase, IceCanContinue);
1689 IceDisposeCompleteMessage (iceConn, authData);
1695 status = (*authProc) (iceConn, authState, False /* don't clean up */,
1700 AuthReply (iceConn, replyDataLen, replyData);
1702 replyWait->sequence_of_request = iceConn->send_sequence;
1711 _IceErrorAuthenticationRejected (iceConn,
1718 _IceErrorAuthenticationFailed (iceConn,
1728 if (iceConn->connect_to_you)
1749 IceDisposeCompleteMessage (iceConn, authData);
1758 IceConn iceConn,
1769 CHECK_AT_LEAST_SIZE (iceConn, ICE_ConnectionReply,
1773 IceReadCompleteMessage (iceConn, SIZEOF (iceConnectionReplyMsg),
1776 if (!IceValidIO (iceConn) || pStart == NULL)
1778 IceDisposeCompleteMessage (iceConn, pStart);
1786 BAIL_STRING (iceConn, ICE_ConnectionReply,
1789 BAIL_STRING (iceConn, ICE_ConnectionReply,
1792 CHECK_COMPLETE_SIZE (iceConn, ICE_ConnectionReply,
1798 if (iceConn->connect_to_you)
1800 if (iceConn->connect_to_you->auth_active)
1807 (iceConn->connect_to_you->my_auth_index)];
1809 (*authProc) (iceConn, &iceConn->connect_to_you->my_auth_state,
1820 _IceErrorBadValue (iceConn, 0,
1846 _IceErrorBadState (iceConn, 0, ICE_ConnectionReply, IceCanContinue);
1851 IceDisposeCompleteMessage (iceConn, pStart);
1860 IceConn iceConn,
1886 CHECK_AT_LEAST_SIZE (iceConn, ICE_ProtocolSetup,
1889 if (iceConn->want_to_close)
1897 iceConn->want_to_close = 0;
1900 IceReadCompleteMessage (iceConn, SIZEOF (iceProtocolSetupMsg),
1903 if (!IceValidIO (iceConn) || pStart == NULL)
1905 IceDisposeCompleteMessage (iceConn, pStart);
1913 BAIL_STRING(iceConn, ICE_ProtocolSetup,
1916 BAIL_STRING(iceConn, ICE_ProtocolSetup,
1919 BAIL_STRING(iceConn, ICE_ProtocolSetup,
1922 BAIL_STRING(iceConn, ICE_ProtocolSetup,
1926 CHECK_COMPLETE_SIZE (iceConn, ICE_ProtocolSetup,
1934 _IceErrorBadValue (iceConn, 0,
1936 IceDisposeCompleteMessage (iceConn, pStart);
1942 if (iceConn->process_msg_info &&
1943 (int) message->protocolOpcode >= iceConn->his_min_opcode &&
1944 (int) message->protocolOpcode <= iceConn->his_max_opcode &&
1945 iceConn->process_msg_info[
1946 message->protocolOpcode - iceConn->his_min_opcode].in_use)
1948 _IceErrorMajorOpcodeDuplicate (iceConn, message->protocolOpcode);
1949 IceDisposeCompleteMessage (iceConn, pStart);
1956 _IceErrorSetupFailed (iceConn, message->protocolOpcode,
1958 IceDisposeCompleteMessage (iceConn, pStart);
1962 if (iceConn->process_msg_info)
1965 i <= (iceConn->his_max_opcode - iceConn->his_min_opcode); i++)
1967 if (iceConn->process_msg_info[i].in_use && strcmp (protocolName,
1968 iceConn->process_msg_info[i].protocol->protocol_name) == 0)
1970 _IceErrorProtocolDuplicate (iceConn, protocolName);
1972 IceDisposeCompleteMessage (iceConn, pStart);
1991 _IceErrorUnknownProtocol (iceConn, protocolName);
1993 IceDisposeCompleteMessage (iceConn, pStart);
2031 _IceErrorNoVersion (iceConn, ICE_ProtocolSetup);
2044 IceDisposeCompleteMessage (iceConn, pStart);
2052 iceConn->connection_string, myAuthCount,
2091 _IceErrorNoAuthentication (iceConn, ICE_ProtocolSetup);
2095 char *hostname = _IceGetPeerName (iceConn);
2103 _IceErrorAuthenticationRejected (iceConn,
2122 status = (*authProc) (iceConn, &authState, swap, 0, NULL,
2129 AuthRequired (iceConn, hisAuthIndex, authDataLen, authData);
2131 iceConn->protosetup_to_me = setupInfo =
2176 status = (*protocolSetupProc) (iceConn,
2190 AcceptProtocol (iceConn, hisOpcode, myOpcode, hisVersionIndex,
2201 process_msg_info = &iceConn->process_msg_info[hisOpcode -
2202 iceConn->his_min_opcode];
2213 iceConn->proto_ref_count++;
2225 (*protocolActivateProc) (iceConn,
2235 _IceErrorSetupFailed (iceConn, ICE_ProtocolSetup, failureReason);
2253 IceDisposeCompleteMessage (iceConn, pStart);
2261 IceConn iceConn,
2272 CHECK_AT_LEAST_SIZE (iceConn, ICE_ProtocolReply,
2276 IceReadCompleteMessage (iceConn, SIZEOF (iceProtocolReplyMsg),
2279 if (!IceValidIO (iceConn))
2281 IceDisposeCompleteMessage (iceConn, pStart);
2289 BAIL_STRING(iceConn, ICE_ProtocolReply,
2292 BAIL_STRING(iceConn, ICE_ProtocolReply,
2295 CHECK_COMPLETE_SIZE (iceConn, ICE_ProtocolReply,
2301 if (iceConn->protosetup_to_you)
2303 if (iceConn->protosetup_to_you->auth_active)
2310 iceConn->protosetup_to_you->my_opcode - 1].orig_client;
2313 (iceConn->protosetup_to_you->my_auth_index)];
2315 (*authProc) (iceConn,
2316 &iceConn->protosetup_to_you->my_auth_state,
2327 _IceErrorBadValue (iceConn, 0,
2351 _IceErrorBadState (iceConn, 0, ICE_ProtocolReply, IceCanContinue);
2356 IceDisposeCompleteMessage (iceConn, pStart);
2365 IceConn iceConn,
2369 CHECK_SIZE_MATCH (iceConn, ICE_Ping,
2372 PingReply (iceConn);
2381 IceConn iceConn,
2385 CHECK_SIZE_MATCH (iceConn, ICE_PingReply,
2388 if (iceConn->ping_waits)
2390 _IcePingWait *next = iceConn->ping_waits->next;
2392 (*iceConn->ping_waits->ping_reply_proc) (iceConn,
2393 iceConn->ping_waits->client_data);
2395 free (iceConn->ping_waits);
2396 iceConn->ping_waits = next;
2400 _IceErrorBadState (iceConn, 0, ICE_PingReply, IceCanContinue);
2410 IceConn iceConn,
2417 CHECK_SIZE_MATCH (iceConn, ICE_WantToClose,
2420 if (iceConn->want_to_close || iceConn->open_ref_count == 0)
2424 * WantToClose, so we close the connection, or the iceConn
2427 * the iceConn->open_ref_count reached zero, but then we
2431 _IceConnectionClosed (iceConn); /* invoke watch procs */
2432 _IceFreeConnection (iceConn);
2435 else if (iceConn->proto_ref_count > 0)
2442 IceSimpleMessage (iceConn, 0, ICE_NoClose);
2443 IceFlush (iceConn);
2448 * The reference count on this iceConn is zero. This means that
2455 if (!iceConn->protosetup_to_you)
2457 IceSimpleMessage (iceConn, 0, ICE_NoClose);
2458 IceFlush (iceConn);
2469 IceConn iceConn,
2473 CHECK_SIZE_MATCH (iceConn, ICE_NoClose,
2476 if (iceConn->want_to_close)
2483 iceConn->want_to_close = 0;
2487 _IceErrorBadState (iceConn, 0, ICE_NoClose, IceCanContinue);
2497 IceConn iceConn,
2514 replyReady = ProcessError (iceConn, length, swap, replyWait);
2519 ProcessConnectionSetup (iceConn, length, swap);
2524 replyReady = ProcessAuthRequired (iceConn, length, swap, replyWait);
2529 ProcessAuthReply (iceConn, length, swap);
2534 replyReady = ProcessAuthNextPhase (iceConn, length, swap, replyWait);
2539 replyReady = ProcessConnectionReply (iceConn, length, swap, replyWait);
2544 ProcessProtocolSetup (iceConn, length, swap);
2549 replyReady = ProcessProtocolReply (iceConn, length, swap, replyWait);
2554 ProcessPing (iceConn, length);
2559 ProcessPingReply (iceConn, length);
2564 ProcessWantToClose (iceConn, length, connectionClosedRet);
2569 ProcessNoClose (iceConn, length);
2574 _IceErrorBadMinor (iceConn, 0, opcode, IceCanContinue);
2575 _IceReadSkip (iceConn, length << 3);